Skip to content

Commit

Permalink
bgpd: fix build error
Browse files Browse the repository at this point in the history
I recieve the following error with GCC 9.4.0:
```
In file included from /usr/include/string.h:495,
                 from ./lib/zebra.h:23,
                 from bgpd/bgp_snmp_bgp4v2.c:7:
In function ‘memset’,
    inlined from ‘bgp4v2PathAttrLookup’ at bgpd/bgp_snmp_bgp4v2.c:605:3,
    inlined from ‘bgp4v2PathAttrTable’ at bgpd/bgp_snmp_bgp4v2.c:747:9:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:71:10: error: ‘__builtin_memset’ offset [9, 20] from the object at ‘paddr’ is out of the bounds of referenced subobject ‘_v4_addr’ with type ‘struct in_addr’ at offset 4 [-Werror=array-bounds]
   71 |   return __builtin___memset_chk (__dest, __ch, __len, __bos0 (__dest));
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```

Signed-off-by: Igor Ryzhov <[email protected]>
  • Loading branch information
idryzhov committed Nov 12, 2023
1 parent 19bcca4 commit 6eb79dd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bgpd/bgp_snmp_bgp4v2.c
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,7 @@ bgp4v2PathAttrLookup(struct variable *v, oid name[], size_t *length,
family = AF_INET;
else
family = AF_INET6;
memset(&paddr.ip._v4_addr, 0, sizeof(paddr.ip));
memset(&paddr.ip, 0, sizeof(paddr.ip));
}

do {
Expand Down

0 comments on commit 6eb79dd

Please sign in to comment.