]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
readelf: check note namesz and descsz
authoremaste <emaste@FreeBSD.org>
Wed, 4 Mar 2020 20:29:49 +0000 (20:29 +0000)
committeremaste <emaste@FreeBSD.org>
Wed, 4 Mar 2020 20:29:49 +0000 (20:29 +0000)
commite3abca0edc2843469e172a5cc2ac126a2540b14b
treeae8c36f563912c4ff73071486075ba81749205fe
parent031d3981bdfb4348907a077bc81675529351df51
readelf: check note namesz and descsz

Previously corrupt note namesz or descsz (perhaps caused by readelf's
current lack of endian support for notes) resulted in a crash.  Check
that namesz and descsz do not extend beyond the end of the buffer before
trying to access name and desc data.

Reported by: jhb
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
contrib/elftoolchain/readelf/readelf.c