Page MenuHomeFreeBSD

ng_parse: Add upper bound to avoid possible overflow
ClosedPublic

Authored by emaste on Aug 25 2025, 2:47 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Oct 14, 3:46 AM
Unknown Object (File)
Fri, Oct 10, 5:42 AM
Unknown Object (File)
Fri, Oct 10, 5:42 AM
Unknown Object (File)
Fri, Oct 10, 5:42 AM
Unknown Object (File)
Fri, Oct 10, 5:42 AM
Unknown Object (File)
Fri, Oct 10, 12:09 AM
Unknown Object (File)
Thu, Oct 9, 9:35 PM
Unknown Object (File)
Wed, Oct 8, 8:52 PM

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Keeping num const is desirable IMO but we can indeed sort it after the other variables.

sys/netgraph/ng_parse.c
1382

Do we know that we can trust num here? because if not...

1401

...then we are blindly indexing an array here without checking if we're within bounds.

1539

pre-existing style nit here

1545

pre-existing style nit here

sys/netgraph/ng_parse.c
1382

It's been something like two decades since I've looked at netgraph in depth, so I'm not really sure. Should definitely look into this but I'd like to commit this review as an improvement independent of that question.

1539

It seems ng_parse.c omits the () on all or nearly all return statements so I'm not inclined to change this

This revision is now accepted and ready to land.Aug 29 2025, 9:41 AM