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

segfault due to dereference near-null pointer in formUpdateBuffer #22

Closed
kcwu opened this issue Aug 19, 2016 · 2 comments

Comments

Projects
None yet
2 participants
@kcwu
Copy link
Contributor

commented Aug 19, 2016

Input:

00000000: 3c74 6162 6c65 3e3c 623c 3e00 3c6c 6973  <table><b<>.<lis
00000010: 7469 6e67 3e3c 696e 7465 726e 616c 3e3c  ting><internal><
00000020: 696e 7075 743e                           input>

gdb trace:

Program received signal SIGSEGV, Segmentation fault.
0x000000000044f596 in formUpdateBuffer (a=0x7e0000, buf=0x7d3e00, form=0x7dff80) at form.c:474
474             col = COLPOS(l, a->start.pos);
(gdb) p l
$1 = (Line *) 0x0
(gdb) bt
#0  0x000000000044f596 in formUpdateBuffer (a=0x7e0000, buf=0x7d3e00, form=0x7dff80) at form.c:474
#1  0x000000000044ed05 in formResetBuffer (buf=0x7d3e00, formitem=0x7da360) at form.c:272
#2  0x000000000042c773 in loadHTMLBuffer (f=0x7fffffffd130, newBuf=0x7d3e00) at file.c:6778
#3  0x0000000000416a90 in loadSomething (f=0x7fffffffd130, loadproc=0x42c61d <loadHTMLBuffer>, defaultbuf=0x7d3e00) at file.c:224
#4  0x000000000041c8ae in loadGeneralFile (path=0x7c3b00 "to-report/1159", current=0x0, referer=0xffffffffffffffff <error: Cannot access memory at address 0xffffffffffffffff>,
    flag=0, request=0x0) at file.c:2245
#5  0x0000000000407121 in main (argc=5, argv=0x7fffffffd458, envp=0x7fffffffd488) at main.c:1020

This is found by afl-fuzz

@kcwu

This comment has been minimized.

Copy link
Contributor Author

commented Aug 20, 2016

similar input

00000000: 3c74 6162 6c65 3e3c 623c 3e00 3c6c 6973  <table><b<>.<lis
00000010: 7469 6e67 3e3c 696e 7465 726e 616c 3e3c  ting><internal><
00000020: 7465 7874 6172 6561 3e                   textarea>

tats added a commit that referenced this issue Aug 24, 2016

@tats

This comment has been minimized.

Copy link
Owner

commented Aug 24, 2016

Fixed, thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.