You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running the program with -d and doc->code is null, a null pointer dereference occurs.
This bug affects versions 2.x and 3.0.0a.
Reproduce
Run:
./markdown -d -s ''
# or feed the program with three lines of "%"
echo -ne '%\n%\n%\n' | ./markdown -d
Result:
root@worklab ~/f/d/src (main) [1]# ./markdown -d -s ''
AddressSanitizer:DEADLYSIGNAL
=================================================================
==18163==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x55f7546656fc bp 0x7ffdb5c70f10 sp 0x7ffdb5c70de0 T0)
==18163==The signal is caused by a READ memory access.
==18163==Hint: address points to the zero page.
#0 0x55f7546656fc in mkd3_dump /root/fuzz/discount/src/dumptree.c:151:48
#1 0x55f754649825 in main /root/fuzz/discount/src/main.c:366:11
#2 0x7f4d3448d6c9 in __libc_start_call_main csu/../sysdeps/nptl/libc_start_call_main.h:58:16
#3 0x7f4d3448d784 in __libc_start_main csu/../csu/libc-start.c:360:3
#4 0x55f7545713f0 in _start (/root/fuzz/discount/src/markdown+0x283f0) (BuildId: afc94b815b20ad8be244845d74b6694ea7bab3d9)
AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV /root/fuzz/discount/src/dumptree.c:151:48 in mkd3_dump
==18163==ABORTING
Reason
In function mkd_dump(), doc->code->next is used without check.
Possible fix
Add a check.
The text was updated successfully, but these errors were encountered:
Oh drat. Thank you for finding this annoying buglet. The code has been modified and now does the trivial test for non-null pointering before using the pointed to structure, and I've mirrored it here for
your verifying enjoyment.
When running the program with -d and
doc->code
is null, a null pointer dereference occurs.This bug affects versions 2.x and 3.0.0a.
Reproduce
Run:
Result:
Reason
In function
mkd_dump()
,doc->code->next
is used without check.Possible fix
Add a check.
The text was updated successfully, but these errors were encountered: