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.
This commit is contained in:
@@ -7,7 +7,7 @@ typedef struct {
|
||||
int size;
|
||||
} strbuffer_t;
|
||||
|
||||
void strbuffer_init(strbuffer_t *strbuff);
|
||||
int strbuffer_init(strbuffer_t *strbuff);
|
||||
void strbuffer_close(strbuffer_t *strbuff);
|
||||
|
||||
const char *strbuffer_value(strbuffer_t *strbuff);
|
||||
|
||||
Reference in New Issue
Block a user