global-buffer-overflow in arrow_path at gensvg.c:1082
Xfig is a diagramming tool
Brought to you by:
tklxfiguser
Hi,
I found a global-buffer-overflow in arrow_path at gensvg.c:1082
fig2dev Version 3.2.7b
commit ca48ccc90bd3e7801a63cf9a541f292b28ed1260
Please run following command to reproduce it,
fig2dev -L svg $PoC
ASAN LOG
==45947==ERROR: AddressSanitizer: global-buffer-overflow on address 0x000001903b98 at pc 0x0000008be954 bp 0x7ffdf7a01100 sp 0x7ffdf7a010f8
READ of size 4 at 0x000001903b98 thread T0
#0 0x8be953 in arrow_path /home/tmp/mcj-fig2dev/fig2dev/dev/gensvg.c:1082:40
#1 0x8accb8 in svg_arrows /home/tmp/mcj-fig2dev/fig2dev/dev/gensvg.c:1174:2
#2 0x8b38a0 in gensvg_arc /home/tmp/mcj-fig2dev/fig2dev/dev/gensvg.c:907:9
#3 0x549d5b in gendev_objects /home/tmp/mcj-fig2dev/fig2dev/fig2dev.c:1007:6
#4 0x549d5b in main /home/tmp/mcj-fig2dev/fig2dev/fig2dev.c:484
#5 0x7f012ef65b96 in __libc_start_main /build/glibc-OTsEL5/glibc-2.27/csu/../csu/libc-start.c:310
#6 0x41b469 in _start (/home/tmp/fig2dev+0x41b469)
0x000001903b98 is located 8 bytes to the left of global variable 'fpoints' defined in 'gensvg.c:1130:18' (0x1903ba0) of size 400
0x000001903b98 is located 52 bytes to the right of global variable 'bnclippoints' defined in 'gensvg.c:1129:41' (0x1903b60) of size 4
SUMMARY: AddressSanitizer: global-buffer-overflow /home/tmp/mcj-fig2dev/fig2dev/dev/gensvg.c:1082:40 in arrow_path
Shadow bytes around the buggy address:
0x000080318720: 01 f9 f9 f9 f9 f9 f9 f9 00 f9 f9 f9 f9 f9 f9 f9
0x000080318730: 01 f9 f9 f9 f9 f9 f9 f9 04 f9 f9 f9 f9 f9 f9 f9
0x000080318740: 00 00 00 00 04 f9 f9 f9 f9 f9 f9 f9 04 f9 f9 f9
0x000080318750: f9 f9 f9 f9 04 f9 f9 f9 f9 f9 f9 f9 04 f9 f9 f9
0x000080318760: f9 f9 f9 f9 04 f9 f9 f9 f9 f9 f9 f9 04 f9 f9 f9
=>0x000080318770: f9 f9 f9[f9]00 00 00 00 00 00 00 00 00 00 00 00
0x000080318780: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x000080318790: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0000803187a0: 00 00 00 00 00 00 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9
0x0000803187b0: f9 f9 f9 f9 00 00 00 00 00 00 00 00 00 00 00 00
0x0000803187c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Shadow byte legend (one shadow byte represents 8 application bytes):
Addressable: 00
Partially addressable: 01 02 03 04 05 06 07
Heap left redzone: fa
Freed heap region: fd
Stack left redzone: f1
Stack mid redzone: f2
Stack right redzone: f3
Stack after return: f5
Stack use after scope: f8
Global redzone: f9
Global init order: f6
Poisoned by user: f7
Container overflow: fc
Array cookie: ac
Intra object redzone: bb
ASan internal: fe
Left alloca redzone: ca
Right alloca redzone: cb
==45947==ABORTING
Fixed with commit [c72ffd].
Related
Commit: [c72ffd]