Skip to content

Commit

Permalink
bgpd: fix pointer arithmetic in bgp snmp module
Browse files Browse the repository at this point in the history
Fix a bgpd coverity warning in an snmp module.

Signed-off-by: Mark Stapp <mjs@labn.net>
  • Loading branch information
Mark Stapp committed Sep 21, 2023
1 parent 438ef98 commit d9bd9eb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bgpd/bgp_snmp_bgp4.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit d9bd9eb

Please sign in to comment.