]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
readelf: check note namesz and descsz
authorEd Maste <emaste@FreeBSD.org>
Wed, 4 Mar 2020 20:29:49 +0000 (20:29 +0000)
committerEd Maste <emaste@FreeBSD.org>
Wed, 4 Mar 2020 20:29:49 +0000 (20:29 +0000)
commit721ac29c0c1193932234754608b038d9f73a3415
treeae8c36f563912c4ff73071486075ba81749205fe
parentc30e9beba01bfde9e7bde6cfecffd0798639027b
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