]> git.ipfire.org Git - thirdparty/elfutils.git/commit
libelf: check decompressed ZSTD size
authorAleksei Vetrov <vvvvvv@google.com>
Thu, 23 Nov 2023 15:31:47 +0000 (15:31 +0000)
committerMark Wielaard <mark@klomp.org>
Thu, 23 Nov 2023 23:15:41 +0000 (00:15 +0100)
commit03c171947cc538b04957ac2222ce86e7c0170bd1
tree9b441eecb18c303b9d0f1f9f893d9cb49a03a7a9
parent2f38fa57942f95a9ada35e6802df864747c81cce
libelf: check decompressed ZSTD size

Decompression functions like __libelf_decompress_zlib check that
decompressed data has the same size as it was declared in the header
(size_out argument). The same check is now added to
__libelf_decompress_zstd to make sure that the whole allocated buffer is
initialized.

    * libelf/elf_compress.c (__libelf_decompress_zstd): Use return value
      of ZSTD_decompress to check that decompressed data size is the
      same as size_out of the buffer that was allocated.

Signed-off-by: Aleksei Vetrov <vvvvvv@google.com>
libelf/elf_compress.c