diff --git a/bgpd/bgp_packet.c b/bgpd/bgp_packet.c index 3f38790cbda3..5d9789432646 100644 --- a/bgpd/bgp_packet.c +++ b/bgpd/bgp_packet.c @@ -3694,7 +3694,7 @@ static void bgp_dynamic_capability_software_version(uint8_t *pnt, int action, char soft_version[BGP_MAX_SOFT_VERSION + 1] = {}; if (action == CAPABILITY_ACTION_SET) { - if (data + len > end) { + if (data + len + 1 > end) { zlog_err("%pBP: Received invalid Software Version capability length %d", peer, len); return;