lewdlime / abcm2ps

abcm2ps is a command line program which converts ABC to music sheet in PostScript or SVG format. It is an extension of abc2ps which may handle many voices per staff. abcm2ps is Copyright © 2014-2016 Jean-Francois Moine.
http://moinejf.free.fr/
GNU General Public License v3.0
84 stars 31 forks source link

crash in parse.c function set_tuplet #90

Open Microsvuln opened 3 years ago

Microsvuln commented 3 years ago

There is a crash in the parse.c file and in set_tuplet when parsing a specific input file.

It's a high probability that it is a divide-by-zero error.

Output :

poc4:51:12: error: Bad character 'o'
AddressSanitizer:DEADLYSIGNAL
=================================================================
==29307==ERROR: AddressSanitizer: FPE on unknown address 0x00000062c842 (pc 0x00000062c842 bp 0x7fff4df03730 sp 0x7fff4df03480 T0)
    #0 0x62c842 in set_tuplet /home/arash/abcm2ps/parse.c:6250:31
    #1 0x62c842 in do_tune /home/arash/abcm2ps/parse.c:3630:4
    #2 0x54a1da in abc_eof /home/arash/abcm2ps/abcparse.c:202:2
    #3 0x54a1da in frontend /home/arash/abcm2ps/front.c:905:2
    #4 0x33549c in treat_file /home/arash/abcm2ps/abcm2ps.c:240:2
    #5 0x339393 in main /home/arash/abcm2ps/abcm2ps.c:1041:3
    #6 0x7f5fd7149bf6 in __libc_start_main /build/glibc-S9d2JN/glibc-2.27/csu/../csu/libc-start.c:310
    #7 0x2868d9 in _start (/home/arash/abcm2ps/abcm2ps.laf.asan+0x2868d9)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: FPE /home/arash/abcm2ps/parse.c:6250:31 in set_tuplet
==29307==ABORTING

poc4.zip

To reproduce :

./abcm2ps poc4