A malloc size error in tiffinfo.c:228:25
System info
Ubuntu x86_64, gcc (Ubuntu 5.5.0-12ubuntu1), tiff2pdf (libtiff latest master 1373f8da)
Configure
CFLAGS="-g -fsanitize=address" LDFLAGS="-fsanitize=address" ./configure
Command line
./tools/tiffinfo -D -f lsb2msb -j -s -z @@
AddressSanitizer output
==34111==WARNING: AddressSanitizer failed to allocate 0x1c20002cc40011d0 bytes
==34111==AddressSanitizer's allocator is terminating the process instead of returning 0
==34111==If you don't like this behavior set allocator_may_return_null=1
==34111==AddressSanitizer CHECK failed: /build/llvm-toolchain-6.0-QjOn7h/llvm-toolchain-6.0-6.0/projects/compiler-rt/lib/sanitizer_common/sanitizer_allocator.cc:225 "((0)) != (0)" (0x0, 0x0)
#0 0x4e4435 in __asan::AsanCheckFailed(char const*, int, char const*, unsigned long long, unsigned long long) (/home/seviezhou/libtiff/tools/tiffinfo+0x4e4435)
#1 0x501ce5 in __sanitizer::CheckFailed(char const*, int, char const*, unsigned long long, unsigned long long) (/home/seviezhou/libtiff/tools/tiffinfo+0x501ce5)
#2 0x4ea826 in __sanitizer::ReportAllocatorCannotReturnNull() (/home/seviezhou/libtiff/tools/tiffinfo+0x4ea826)
#3 0x4ea866 in __sanitizer::ReturnNullOrDieOnFailure::OnBadRequest() (/home/seviezhou/libtiff/tools/tiffinfo+0x4ea866)
#4 0x4263e6 in __asan::asan_malloc(unsigned long, __sanitizer::BufferedStackTrace*) (/home/seviezhou/libtiff/tools/tiffinfo+0x4263e6)
#5 0x4db2bb in __interceptor_malloc (/home/seviezhou/libtiff/tools/tiffinfo+0x4db2bb)
#6 0x598dc4 in _TIFFmalloc /home/seviezhou/libtiff/libtiff/tif_unix.c:314:10
#7 0x514ab7 in TIFFReadContigStripData /home/seviezhou/libtiff/tools/tiffinfo.c:228:25
#8 0x5178a1 in TIFFReadData /home/seviezhou/libtiff/tools/tiffinfo.c:387:4
#9 0x51493b in tiffinfo /home/seviezhou/libtiff/tools/tiffinfo.c:544:3
#10 0x514035 in main /home/seviezhou/libtiff/tools/tiffinfo.c:160:6
#11 0x7f9c68000b96 in __libc_start_main /build/glibc-OTsEL5/glibc-2.27/csu/../csu/libc-start.c:310
#12 0x41b429 in _start (/home/seviezhou/libtiff/tools/tiffinfo+0x41b429)