This was flagged in the MIR[1] review for frr.
There is an incorrect strncmp() usage in the code that was flagged by gcc:
bgpd/bgp_community_alias.c: In function ‘bgp_ca_alias_hash_cmp’: bgpd/bgp_community_alias.c:60:17: warning: ‘strncmp’ specified bound 8228 exceeds source size 8192 [-Wstringop-overread] 60 | return (strncmp(ca1->alias, ca2->alias, sizeof(struct community_alias)) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ bgpd/bgp_community_alias.c: In function ‘bgp_ca_community_hash_cmp’: bgpd/bgp_community_alias.c:43:17: warning: ‘strncmp’ specified bound 8228 exceeds source size 36 [-Wstringop-overread] 43 | return (strncmp(ca1->community, ca2->community, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 44 | sizeof(struct community_alias)) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I filed an upstream bug[2], and it was fixed[3].
1. https://bugs.launchpad.net/ubuntu/+source/frr/+bug/1951834 2. https://github.com/FRRouting/frr/issues/10484 3. https://github.com/FRRouting/frr/pull/10485
This was flagged in the MIR[1] review for frr.
There is an incorrect strncmp() usage in the code that was flagged by gcc:
bgpd/bgp_ community_ alias.c: In function ‘bgp_ca_ alias_hash_ cmp’: community_ alias.c: 60:17: warning: ‘strncmp’ specified bound 8228 exceeds source size 8192 [-Wstringop- overread] ca1->alias, ca2->alias, sizeof(struct community_alias)) ~~~~~~~ ~~~~~~~ ~~~~~~~ ~~~~~~~ ~~~~~~~ ~~~~~~~ ~~~~~~~ ~~~~~~~ community_ alias.c: In function ‘bgp_ca_ community_ hash_cmp’ : community_ alias.c: 43:17: warning: ‘strncmp’ specified bound 8228 exceeds source size 36 [-Wstringop- overread] ca1->community, ca2->community, ~~~~~~~ ~~~~~~~ ~~~~~~~ ~~~~~~~ ~~~~ ~~~~~~~ ~~~~~~~ ~~~~~~~ ~~~
bgpd/bgp_
60 | return (strncmp(
| ^~~~~~~
bgpd/bgp_
bgpd/bgp_
43 | return (strncmp(
| ^~~~~~~
44 | sizeof(struct community_alias))
| ~~~~~~~
I filed an upstream bug[2], and it was fixed[3].
1. https:/ /bugs.launchpad .net/ubuntu/ +source/ frr/+bug/ 1951834 /github. com/FRRouting/ frr/issues/ 10484 /github. com/FRRouting/ frr/pull/ 10485
2. https:/
3. https:/