]> git.puffer.fish Git - mirror/frr.git/commitdiff
Revert "bgpd: fix pointer arithmetic in bgp snmp module" 15830/head
authorLouis Scalbert <louis.scalbert@6wind.com>
Tue, 23 Apr 2024 09:39:29 +0000 (11:39 +0200)
committerMergify <37929162+mergify[bot]@users.noreply.github.com>
Wed, 24 Apr 2024 11:26:21 +0000 (11:26 +0000)
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>
(cherry picked from commit c1124a44c34f5fdce5fd06a6441ea78f8b5f352b)

bgpd/bgp_snmp_bgp4.c

index 3d04dc2ece90e7d9ebaed0ebf9ff4ac9203b25fb..755777c167898f630a8833b65d6b6e963b455397 100644 (file)
@@ -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,