Fix json_loadf and json_loadfd with empty input
authorPetri Lehtinen <petri@digip.org>
Mon, 22 Jun 2009 18:09:25 +0000 (21:09 +0300)
committerPetri Lehtinen <petri@digip.org>
Tue, 30 Jun 2009 10:55:20 +0000 (13:55 +0300)
commitb1fe723a7f7261e1127ffb17c7ff564918e88203
tree40aac57bf10f00bbe2a47999cbff2148128d61af
parentdc9b954b62145d114cbf9039ed6c8fb57b30ac36
Fix json_loadf and json_loadfd with empty input

Nothing was appended to strbuffer, so the buffer was left empty. An
empty strbuffer is not an empty string but NULL, so the result was a
segfault.

This patch fixes the problem by initializing strbuffer to an empty
string.
src/dump.c
src/load.c
src/strbuffer.c
src/strbuffer.h