Skip to content

fix(cmd): avoid nil pointer panic in CLI when NLRI cannot be decoded#3426

Closed
SAY-5 wants to merge 2 commits into
osrg:masterfrom
SAY-5:fix-cli-evpn-nil-nlri-panic
Closed

fix(cmd): avoid nil pointer panic in CLI when NLRI cannot be decoded#3426
SAY-5 wants to merge 2 commits into
osrg:masterfrom
SAY-5:fix-cli-evpn-nil-nlri-panic

Conversation

@SAY-5
Copy link
Copy Markdown
Contributor

@SAY-5 SAY-5 commented May 24, 2026

gobgp global rib -a evpn panics with a nil pointer dereference when a path's NLRI cannot be decoded (issue #3354). makeShowRouteArgs ignores the error from apiutil.GetNativeNlri and then calls nlri.String() on the nil interface.

This guards the decode result: when the NLRI is nil, a "?" placeholder is used instead of dereferencing it, so the rest of the table still renders. The JSON output (-j) was unaffected because it does not go through this formatter.

Added a regression test that asserts makeShowRouteArgs no longer panics for an undecodable path.

@fujita
Copy link
Copy Markdown
Member

fujita commented May 24, 2026

Thanks, please fix the lint error.

@SAY-5
Copy link
Copy Markdown
Contributor Author

SAY-5 commented May 24, 2026

Fixed the gofumpt import ordering in neighbor_test.go. CI should be green now.

@fujita
Copy link
Copy Markdown
Member

fujita commented May 24, 2026

Squashed and pushed, thanks.

@fujita fujita closed this May 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants