Merge pull request #14260 from opensourcerouting/fix/do_not_process_nlri_if_attribute_len_is_0

bgpd: Do not process NLRIs if the attribute length is zero
This commit is contained in:
Donald Sharp 2023-08-24 10:55:51 -04:00 committed by GitHub
commit 42016422ce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2049,7 +2049,7 @@ static int bgp_update_receive(struct peer *peer, bgp_size_t size)
/* Network Layer Reachability Information. */
update_len = end - stream_pnt(s);
if (update_len) {
if (update_len && attribute_len) {
/* Set NLRI portion to structure. */
nlris[NLRI_UPDATE].afi = AFI_IP;
nlris[NLRI_UPDATE].safi = SAFI_UNICAST;