When compiling giflib and the command line tools in the util subdir with Address Sanitizer (CFLAGS="-fsanitize=address") most of them won't even run, because already a simple call will result in an invalid memory access.
I'll attach a sample output for gif2rgb. The issue seems to be in the args parsing routinges:
==7656==ERROR: AddressSanitizer: stack-buffer-underflow on address 0x7fffb06b8870 at pc 0x40b015 bp 0x7fffb06b7b80 sp 0x7fffb06b7b70
READ of size 8 at 0x7fffb06b8870 thread T0
#0 0x40b014 in GAGetArgs /tmp/giflib-5.1.1/util/getarg.c:177
#1 0x402dda in main /tmp/giflib-5.1.1/util/gif2rgb.c:507
#2 0x7f11582c4f9f in __libc_start_main (/lib64/libc.so.6+0x1ff9f)
#3 0x406cf1 (/mnt/ram/giflib-5.1.1/util/gif2rgb+0x406cf1)
Log in to post a comment.