Page MenuHomeFreeBSD

netlink: Avoid potential undefined behaviour
ClosedPublic

Authored by emaste on Fri, May 22, 2:55 PM.

Details

Summary

The KASSERT indicates that the index is guaranteed not to be OOB.

Reported by: des

Diff Detail

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

Event Timeline

Agreed but I didn't report this, I reported something else that I now realize is a non-issue (the assignment on line 139 is ok because of the check on line 123, and the assignment on line 147 is ok because of the check on line 141)

sys/netlink/netlink_generic.c
98

You can just return this, no need for a temporary variable now.

This revision is now accepted and ready to land.Fri, May 22, 3:24 PM
This revision now requires review to proceed.Sat, May 23, 4:27 PM
This revision is now accepted and ready to land.Sat, May 23, 4:56 PM
This revision was automatically updated to reflect the committed changes.