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

Already on GitHub? Sign in to your account

Fix json_test.c to avoid crash in realloc() #3

Merged
1 commit merged into from Jan 19, 2011

Conversation

Projects
None yet
1 participant
@ghost

ghost commented Jan 19, 2011

json isn't initialized to NULL in json_test.c so it can cause a crash when realloc tries to dereference it.
Also, errno isn't used so errno.h isn't needed and bzero has apparently been obsoleted by memset according to http://pubs.opengroup.org/onlinepubs/009695399/functions/bzero.html .

errno isn't used so remove include of errno.h.
initialize json to NULL to avoid realloc crash.
use memset instead of obsolete bzero.
Owner

quartzjer commented Jan 19, 2011

Nice cleanup, thx!

This issue was closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment