Skip to content

Commit eb9e286

Browse files
committed
bgpd: do not check attr in bgp_packet_attribute
Fix the following coverity issue. attr cannot be NULL. > CID 1568376 (sonic-net#1 of 1): Dereference before null check (REVERSE_INULL) > check_after_deref: Null-checking attr suggests that it may be null, but it has already been dereferenced on all paths leading to the check. Fixes: 8b531b1 ("bgpd: store and send bgp link-state attributes") Signed-off-by: Louis Scalbert <[email protected]>
1 parent 8640fc9 commit eb9e286

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

bgpd/bgp_attr.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -4982,7 +4982,7 @@ bgp_size_t bgp_packet_attribute(struct bgp *bgp, struct peer *peer,
49824982
}
49834983

49844984
/* BGP Link-State */
4985-
if (attr && attr->link_state) {
4985+
if (attr->link_state) {
49864986
stream_putc(s, BGP_ATTR_FLAG_OPTIONAL);
49874987
stream_putc(s, BGP_ATTR_LINK_STATE);
49884988
stream_putc(s, attr->link_state->length);

0 commit comments

Comments
 (0)