From d9bd9ebbf1c3ab902133e7f47c4b8c073e2df3d4 Mon Sep 17 00:00:00 2001 From: Mark Stapp Date: Thu, 21 Sep 2023 13:30:06 -0400 Subject: [PATCH] bgpd: fix pointer arithmetic in bgp snmp module Fix a bgpd coverity warning in an snmp module. Signed-off-by: Mark Stapp --- bgpd/bgp_snmp_bgp4.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bgpd/bgp_snmp_bgp4.c b/bgpd/bgp_snmp_bgp4.c index 0c391b621e51..692e232a83c2 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 += IN_ADDR_SIZE; + offset++; /* 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 += IN_ADDR_SIZE; + offset++; *offset = rn_p->prefixlen; offset++; oid_copy_in_addr(offset,