Here is a Memory Leak in read.c in commit 582968ea
Command:
./fig2dev -L gbx ./poc.txt
Asan output:
=================================================================
==366705==ERROR: LeakSanitizer: detected memory leaks
Direct leak of 1 byte(s) in 1 object(s) allocated from:
#0 0x4c4b17 in __interceptor_malloc /home/llvm-project-llvmorg-13.0.0/compiler-rt/lib/asan/asan_malloc_linux.cpp:129:3
#1 0x52435e in attach_comments /home/afl-fig2dev/fig2dev/read.c:1738:18
SUMMARY: AddressSanitizer: 1 byte(s) leaked in 1 allocation(s).
I could not reproduce the issue, using llvm 15.0.7.
I did some bisecting and found out, that the segfault was fixed with
commit f35ead0ea199c8920aaa3c483f42d760d7a32fcf (HEAD)
Author: Thomas Loimer thomas.loimer@tuwien.ac.at
Date: Fri May 19 18:33:24 2023 +0200
on my system.
Sorry, now I was able to reproduce, compiling with gcc,
./configure CFLAGS="-O0 -fsanitize=address -fsanitize=undefined -ggdb". I thought that I had tried both gcc and clang, on two systems, but obviously not correctly.Seems to be fixed.