Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Null pointer dereference vulnerability in the function d_cresc() #42

Closed
SegfaultMasters opened this issue Dec 13, 2018 · 0 comments
Closed

Comments

@SegfaultMasters
Copy link

SegfaultMasters commented Dec 13, 2018

Tested environment : 64-bit ubuntu 16.04 LTS

Affected version : 8.14.1-master

Command :
./abcm2ps r -E -g -x -v -O fff -O = -i -k 1 $POC -s 10 -w 1 -m 100 -d 100 -a 0 -f musicfont.fmt -D Bar/ -p -l -I 500 -x -M -N 3 -1 -G -j 0 -b 1 -f -T all -c -B 10

s2 = de->s;
de1 = de->start;		
if (de1) {
s = de1->s;
x = s->x + 3;}

Debug:

GDB :

de1 = de->start;
	 		s = de1->s;
   	 		x = s->x + 3;
   	 //	} else {			/* end without start */
   	 //		if (!first_note) {
   	 //			dd = &deco_def_tb[de->t];
   	 //	 		error(1, s2, "No start of deco !%s!", dd->name);
────────────────────────────────────────────────────────────────────────────────────────────────────────
[#0] Id 1, Name: "abcm2ps", stopped, reason: SIGSEGV
────────────────────────────────────────────────────────────────────────────────────────────────────────
[#0] 0x555555567141 → d_cresc(de=0x5555557eb610)
[#1] 0x5555555698e8 → draw_deco_staff()
[#2] 0x555555572d48 → draw_sym_near()
[#3] 0x555555583dbd → delayed_output(indent=0)
[#4] 0x555555583dbd → output_music()
[#5] 0x555555589501 → generate()
[#6] 0x555555589a78 → gen_ly(eob=0x0)
[#7] 0x55555558f8f8 → do_tune()
[#8] 0x555555561a52 → abc_parse(p=0x5555557f4a20 "", fname=0x5555557f39f0 "POC", ln=0x16b)
[#9] 0x555555579a54 → txt_add_eos(fname=0x5555557f39f0 "POC", linenum=0x16b)
gef➤  p de1
$1 = (struct deco_elt *) 0x0
gef➤  p *de1
Cannot access memory at address 0x0
gef➤  p *de1->s
Cannot access memory at address 0x10
gef➤   i r 
rax            0x1	0x1
rbx            0x5555557eb610	0x5555557eb610
rcx            0x1b	0x1b
rdx            0xc0	0xc0
rsi            0x1	0x1
rdi            0x5555557eb610	0x5555557eb610
rbp            0x5555557be800	0x5555557be800 <deco_def_tb+96>
rsp            0x7fffffffd4c0	0x7fffffffd4c0
r8             0x0	0x0
r9             0x5555557eb610	0x5555557eb610
r10            0x0	0x0
r11            0x5555557e8390	0x5555557e8390
r12            0x0	0x0
r13            0x5555557be7a0	0x5555557be7a0
r14            0x0	0x0
r15            0x5555557c5760	0x5555557c5760
rip            0x555555567141	0x555555567141 <d_cresc+49>
eflags         0x10202	[ IF RF ]
cs             0x33	0x33
ss             0x2b	0x2b
ds             0x0	0x0
es             0x0	0x0
fs             0x0	0x0
gs             0x0	0x0

Valgrind :

Process terminating with default action of signal 11 (SIGSEGV)
Access not within mapped region at address 0x10
 at 0x11B141: d_cresc (deco.c:359)
 by 0x11D8E7: draw_deco_staff (deco.c:1908)
 by 0x126D47: draw_sym_near (draw.c:4216)
 by 0x137DBC: delayed_output (music.c:5085)
 by 0x137DBC: output_music (music.c:5140)
 by 0x13D500: generate (parse.c:1039)
 by 0x13DA77: gen_ly (parse.c:1060)
 by 0x1438F7: do_tune (parse.c:3633)
 by 0x115A51: abc_parse (abcparse.c:177)
 by 0x12DA53: txt_add_eos (front.c:379)
 by 0x12DEE3: frontend (front.c:891)
 by 0x110E2C: treat_file (abcm2ps.c:240)
 by 0x10F9E0: main (abcm2ps.c:1033)
Segmentation fault

Reproducer file - Reproducer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant