Export to GitHub

judyarray - issue #3
uninitialized 'seg' in JudySeg struct causing segmentation fault
Posted on Nov 24, 2011 by
Grumpy Cat
When creating a judy array, judy_open() didn't initialize JudySeg struct's 'seg' field (nor will valloc). This will cause judy_close() randomly segfaults for freeing invalid pointer.
To fix the bug, simply change the segment in judy_open(): <code> if ((seg = valloc(JUDY_seg))) { seg->next = JUDY_seg; } ... </code> to: <code> if ((seg = valloc(JUDY_seg))) { seg->seg = NULL; seg->next = JUDY_seg; } ... </code>
Comment #1
Posted on Apr 5, 2012 by Helpful OxFixed in judy64e.c release file
Status: Fixed
Labels:
Type-Defect
Priority-Medium