Skip to content

Commit

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

bgpd:  fix crash when polling bgp4v2PathAttrTable (backport FRRouting#17245)
  • Loading branch information
riw777 authored Oct 29, 2024
2 parents fd230e4 + 6dcdfd4 commit 680ccfb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion bgpd/bgp_snmp_bgp4v2.c
Original file line number Diff line number Diff line change
Expand Up @@ -933,7 +933,9 @@ static uint8_t *bgp4v2PathAttrTable(struct variable *v, oid name[],
else
return SNMP_IPADDRESS(bgp_empty_addr);
case BGP4V2_NLRI_AS_PATH_CALC_LENGTH:
return SNMP_INTEGER(path->attr->aspath->segments->length);
return SNMP_INTEGER((path->attr->aspath && path->attr->aspath->segments)
? path->attr->aspath->segments->length
: 0);
case BGP4V2_NLRI_AS_PATH:
return aspath_snmp_pathseg(path->attr->aspath, var_len);
case BGP4V2_NLRI_PATH_ATTR_UNKNOWN:
Expand Down

0 comments on commit 680ccfb

Please sign in to comment.