Skip to content

Commit

Permalink
Merge pull request FRRouting#16279 from FRRouting/mergify/bp/stable/1…
Browse files Browse the repository at this point in the history
…0.0/pr-16211

bgpd: Check if we have really enough data before doing memcpy for software version (backport FRRouting#16211)
  • Loading branch information
ton31337 authored Jun 25, 2024
2 parents 812556c + c98ae57 commit bbb2ae0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bgpd/bgp_packet.c
Original file line number Diff line number Diff line change
Expand Up @@ -3557,7 +3557,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;
Expand Down

0 comments on commit bbb2ae0

Please sign in to comment.