diff options
author | Donatas Abraitis <donatas@opensourcerouting.org> | 2023-10-25 06:52:38 +0200 |
---|---|---|
committer | Donatas Abraitis <donatas@opensourcerouting.org> | 2023-10-25 06:52:38 +0200 |
commit | 0df64642169c19f6dce5fd8f97f9c59983cdb7f5 (patch) | |
tree | 27125d0d7a0a5d728820ef24d72eba1545e17384 /bgpd/bgp_packet.c | |
parent | Merge pull request #14639 from donaldsharp/zebra_nexthop_search_up (diff) | |
download | frr-0df64642169c19f6dce5fd8f97f9c59983cdb7f5.tar.xz frr-0df64642169c19f6dce5fd8f97f9c59983cdb7f5.zip |
bgpd: Drop unnecessary null-termination for fqdn
str[len] is already null terminated before:
```
if (len > BGP_MAX_HOSTNAME) {
memcpy(&str, data, BGP_MAX_HOSTNAME);
str[BGP_MAX_HOSTNAME] = '\0';
} else if (len) {
memcpy(&str, data, len);
str[len] = '\0';
}
```
CID: 1569357
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
Diffstat (limited to 'bgpd/bgp_packet.c')
-rw-r--r-- | bgpd/bgp_packet.c | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/bgpd/bgp_packet.c b/bgpd/bgp_packet.c index f955c5057..08c3cbdea 100644 --- a/bgpd/bgp_packet.c +++ b/bgpd/bgp_packet.c @@ -3307,8 +3307,6 @@ static void bgp_dynamic_capability_fqdn(uint8_t *pnt, int action, data += len; if (len) { - str[len] = '\0'; - XFREE(MTYPE_BGP_PEER_HOST, peer->hostname); XFREE(MTYPE_BGP_PEER_HOST, peer->domainname); |