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.

Change-Id: I5933c4bdb39da953117785ed44453f39ccbe4d42
Signed-off-by: Aleksei Vetrov <vvvvvv@google.com>
2 files changed