]> git.ipfire.org Git - thirdparty/elfutils.git/commit
libelf: Check compression ratio before trying to allocate output buffer.
authorMark Wielaard <mark@klomp.org>
Fri, 24 Mar 2017 14:06:04 +0000 (15:06 +0100)
committerMark Wielaard <mark@klomp.org>
Mon, 3 Apr 2017 21:53:10 +0000 (23:53 +0200)
commit8dcc4bf791469a32c3a09ebcc23b309bf75c795f
treee739905ff902cfcc7ea8250ccdfb9fe78e34537c
parentb0b58c5e0b34e54194aa042f2310af58ee7de603
libelf: Check compression ratio before trying to allocate output buffer.

The maximum compression factor (http://www.zlib.net/zlib_tech.html) is
1032:1. Add a sanity check for that before trying to allocate lots of
memory and trying to decompress lots of bogus data.

https://sourceware.org/bugzilla/show_bug.cgi?id=21301

Signed-off-by: Mark Wielaard <mark@klomp.org>
libelf/ChangeLog
libelf/elf_compress.c