summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDonald Sharp <donaldsharp72@gmail.com>2024-01-12 14:34:31 -0500
committerGitHub <noreply@github.com>2024-01-12 14:34:31 -0500
commitf8cce3727fb780e0dc351d16408435633f9e402e (patch)
tree0863e31f740a8ca8c87f55106b28865457a857f4
parentc066b835b4ce94c44989abbf1ada06036c1008f9 (diff)
parent26187b03d9b87b8405349cdb18bbf6889671b211 (diff)
Merge pull request #15139 from FRRouting/mergify/bp/stable/9.1/pr-15091
bgpd: fix ecommunity_fill_pbr_action heap-buffer-overflow (backport #15091)
-rw-r--r--bgpd/bgp_ecommunity.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/bgpd/bgp_ecommunity.c b/bgpd/bgp_ecommunity.c
index c408edb166..1d6c325847 100644
--- a/bgpd/bgp_ecommunity.c
+++ b/bgpd/bgp_ecommunity.c
@@ -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