]> git.ipfire.org Git - thirdparty/elfutils.git/commit
libelf: Sanity check offset and size before trying to malloc and read data.
authorMark Wielaard <mjw@redhat.com>
Fri, 21 Oct 2016 13:24:34 +0000 (15:24 +0200)
committerMark Wielaard <mjw@redhat.com>
Thu, 10 Nov 2016 11:11:00 +0000 (12:11 +0100)
commit09ec02ec7f7e6913d10943148e2a898264345b07
treef144caa8cf844d4643c2a89f84a9bddc993d08d4
parent191000fdedba3fafe4d5b8cddad3f3318b49c3fb
libelf: Sanity check offset and size before trying to malloc and read data.

Bad sh_off or sh_size could trigger a bad malloc or read. Sanity check
the header values first before trying to malloc a huge buffer or reading
any data that will certainly fail.

https://bugzilla.redhat.com/show_bug.cgi?id=1387584

Signed-off-by: Mark Wielaard <mjw@redhat.com>
libelf/ChangeLog
libelf/elf_getdata.c