Merge pull request #15139 from FRRouting/mergify/bp/stable/9.1/pr-15091

bgpd: fix ecommunity_fill_pbr_action heap-buffer-overflow (backport #15091)
This commit is contained in:
Donald Sharp 2024-01-12 14:34:31 -05:00 committed by GitHub
commit f8cce3727f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1581,8 +1581,8 @@ int ecommunity_fill_pbr_action(struct ecommunity_val *ecom_eval,
* in the 'Network Address of Next- Hop'
* field of the associated MP_REACH_NLRI.
*/
struct ecommunity_ip *ip_ecom = (struct ecommunity_ip *)
ecom_eval + 2;
struct ecommunity_ip *ip_ecom =
(struct ecommunity_ip *)&ecom_eval->val[2];
api->u.zr.redirect_ip_v4 = ip_ecom->ip;
} else