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

SIGSEGV on freeing json value #25

Open
mittorn opened this issue May 27, 2020 · 1 comment
Open

SIGSEGV on freeing json value #25

mittorn opened this issue May 27, 2020 · 1 comment

Comments

@mittorn
Copy link

mittorn commented May 27, 2020

http://mittorn.tk/clean2.json

jfes_parse_to_value(&config, file, len, &root);
jfes_free_value(&config, &root);
Program received signal SIGSEGV, Segmentation fault.
0x000055555557345a in jfes_free_value (config=0x7ffffff7cdd0, value=0x603000029f80) at jfes.c:1276
1276                    jfes_value_t *item = value->data.array_val->items[i];
(gdb) bt
#0  0x000055555557345a in jfes_free_value (config=0x7ffffff7cdd0, value=0x603000029f80) at jfes.c:1276
#1  0x0000555555573a4c in jfes_free_value (config=0x7ffffff7cdd0, value=0x60300002a040) at jfes.c:1293
#2  0x0000555555573a4c in jfes_free_value (config=0x7ffffff7cdd0, value=0x60300002a1c0) at jfes.c:1293
#3  0x0000555555573a4c in jfes_free_value (config=0x7ffffff7cdd0, value=0x60300002a310) at jfes.c:1293
#4  0x0000555555573483 in jfes_free_value (config=0x7ffffff7cdd0, value=0x60300002a340) at jfes.c:1277
#5  0x0000555555573a4c in jfes_free_value (config=0x7ffffff7cdd0, value=0x7ffffff7ce10) at jfes.c:1293
@mittorn
Copy link
Author

mittorn commented May 27, 2020

jfes.c:437:29: runtime error: signed integer overflow: 500536217 * 10 cannot be represented in type 'int'
1
jfes.c:1276:31: runtime error: load of misaligned address 0xbebebebebebebebe for type 'struct jfes_value_t *', which requires 8 byte alignment
0xbebebebebebebebe: note: pointer points here
<memory cannot be printed>
(gdb) print value->data.array_val->items
$5 = (jfes_value_t **) 0xbebebebebebebebe

asan marked freed bytes by BE

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