mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-14 16:04:49 +00:00
bgpd: Fixed pointer arithmatic miscalculation
If we increment PTR by i * size each time, we end up doing 1, 3, 6 etc. Signed-off-by: Nigel Kukard <nkukard@lbsd.net>
This commit is contained in:
parent
534fc1957b
commit
3ac053e608
@ -398,9 +398,8 @@ int lcommunity_include(struct lcommunity *lcom, u_char *ptr)
|
|||||||
int i;
|
int i;
|
||||||
u_char *lcom_ptr;
|
u_char *lcom_ptr;
|
||||||
|
|
||||||
lcom_ptr = lcom->val;
|
|
||||||
for (i = 0; i < lcom->size; i++) {
|
for (i = 0; i < lcom->size; i++) {
|
||||||
lcom_ptr += (i * LCOMMUNITY_SIZE);
|
lcom_ptr = lcom->val + (i * LCOMMUNITY_SIZE);
|
||||||
if (memcmp(ptr, lcom_ptr, LCOMMUNITY_SIZE) == 0)
|
if (memcmp(ptr, lcom_ptr, LCOMMUNITY_SIZE) == 0)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user