diff options
author | Louis Scalbert <louis.scalbert@6wind.com> | 2024-04-23 11:39:29 +0200 |
---|---|---|
committer | Louis Scalbert <louis.scalbert@6wind.com> | 2024-04-23 11:39:29 +0200 |
commit | c1124a44c34f5fdce5fd06a6441ea78f8b5f352b (patch) | |
tree | 57d57404f90b3db78a73768f3260a466696bf1fe | |
parent | Revert "ospfd: fix some dicey pointer arith in snmp module" (diff) | |
download | frr-c1124a44c34f5fdce5fd06a6441ea78f8b5f352b.tar.xz frr-c1124a44c34f5fdce5fd06a6441ea78f8b5f352b.zip |
Revert "bgpd: fix pointer arithmetic in bgp snmp module"
This reverts commit d9bd9ebbf1c3ab902133e7f47c4b8c073e2df3d4.
The previous code was correct even if the coverity scanner was
complaining.
Fixes: https://github.com/FRRouting/frr/issues/15680
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
-rw-r--r-- | bgpd/bgp_snmp_bgp4.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/bgpd/bgp_snmp_bgp4.c b/bgpd/bgp_snmp_bgp4.c index 3d04dc2ec..755777c16 100644 --- a/bgpd/bgp_snmp_bgp4.c +++ b/bgpd/bgp_snmp_bgp4.c @@ -401,7 +401,7 @@ static struct bgp_path_info *bgp4PathAttrLookup(struct variable *v, oid name[], /* Set OID offset for prefix. */ offset = name + v->namelen; oid2in_addr(offset, IN_ADDR_SIZE, &addr->prefix); - offset++; + offset += IN_ADDR_SIZE; /* Prefix length. */ addr->prefixlen = *offset; @@ -497,7 +497,7 @@ static struct bgp_path_info *bgp4PathAttrLookup(struct variable *v, oid name[], offset = name + v->namelen; oid_copy_in_addr(offset, &rn_p->u.prefix4); - offset++; + offset += IN_ADDR_SIZE; *offset = rn_p->prefixlen; offset++; oid_copy_in_addr(offset, |