]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
libradius: Fix attribute length validation in rad_get_attr(3)
authorMark Johnston <markj@FreeBSD.org>
Fri, 28 May 2021 14:41:43 +0000 (10:41 -0400)
committerMark Johnston <markj@FreeBSD.org>
Fri, 28 May 2021 17:01:06 +0000 (13:01 -0400)
commitf146c0338c6cba4b782877d6185c99cb6e45d6ec
tree3244e09c2b581b9eabaf9a866d516058459d28ea
parentab177386aa8790c66826be227a1d9e6b482444bb
libradius: Fix attribute length validation in rad_get_attr(3)

The length of the attribute header needs to be excluded when comparing
the attribute length against the length of the packet.  Otherwise,
validation may incorrectly fail when fetching the final attribute in a
message.

Fixes: 8d5c78130 ("libradius: Fix input validation bugs")
Reported by: Peter Eriksson
Tested by: Peter Eriksson
Sponsored by: The FreeBSD Foundation

(cherry picked from commit 6bb5699d2b59491097bc21ffa3c097cdd4853f89)
lib/libradius/radlib.c