fail to allocate in tiffinfo at tiffinfo.c:479
Hello,
We are currently working on fuzz testing feature, and we found a failed to allocate error on tiffinfo
.
The stack traces are as follow:
==29283==WARNING: AddressSanitizer failed to allocate 0x7ffe622bbf30 bytes
==29283==AddressSanitizer CHECK failed: ../../../../src/libsanitizer/sanitizer_common/sanitizer_allocator.cc:218 "((0)) != (0)" (0x0, 0x0)
#0 0x7fd094146bf2 (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xe9bf2)
#1 0x7fd094165575 in __sanitizer::CheckFailed(char const*, int, char const*, unsigned long long, unsigned long long) (/usr/lib/x86_64-linux-gnu/libasan.so.4+0x108575)
#2 0x7fd09414c332 (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xef332)
#3 0x7fd094088efb (/usr/lib/x86_64-linux-gnu/libasan.so.4+0x2befb)
#4 0x7fd09413bef7 in realloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xdeef7)
#5 0x7fd0951be765 in _TIFFrealloc .../libtiff-git/libtiff/tif_unix.c:334
#6 0x55bbd05c205d in TIFFReadRawDataTiled .../libtiff-git/tools/tiffinfo.c:479
#7 0x55bbd05c243f in TIFFReadRawData .../libtiff-git/tools/tiffinfo.c:518
#8 0x55bbd05c25f1 in tiffinfo .../libtiff-git/tools/tiffinfo.c:537
#9 0x55bbd05bfb49 in main .../libtiff-git/tools/tiffinfo.c:159
Here is the full stack trace : full_stacktrace_poc_3.zip
Step to reproduce
We configured tiffinfo
using CFLAGS="-g -O0 -fsanitize=address" CXXFLAGS="-g -O0 -fsanitize=address" ./configure --prefix=$(pwd)/
and build it using make -j10
, and run it with:
./tiffinfo -D -i -c -d -r -s -w <attached file>
Attachment: input_tiffinfo_poc_3.zip
Environment
- OS: Ubuntu 18.04.5 LTS
- GCC version: gcc 7.5.0
- libtiff version: latest commit (07b73cfd) of the master branch in gitlab link
Thank you.