From 3e049754d163feb7bc6f5b64321ee924a6d3daa7 Mon Sep 17 00:00:00 2001 From: Eric Fischer Date: Wed, 5 Feb 2014 17:28:45 -0800 Subject: [PATCH] Fix null dereferences --- json.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/json.c b/json.c index d812585a..824700a6 100644 --- a/json.c +++ b/json.c @@ -162,7 +162,7 @@ json_object *json_parse(FILE *f, json_object *current) { if (current->parent == NULL || (current->parent->type != JSON_ARRAY && current->parent->type != JSON_HASH)) { - json_error(", not in array or hash: %d\n", current->parent->type); + json_error(", not in array or hash\n"); } return json_parse(f, current->parent); @@ -170,10 +170,10 @@ json_object *json_parse(FILE *f, json_object *current) { if (c == ':') { if (current->parent == NULL || current->parent->type != JSON_HASH) { - json_error(": not in hash: %d\n", current->parent); + json_error(": not in hash\n"); } - if (current->parent->hash == NULL || current->parent->hash->value != NULL) { - json_error(": without key: %d\n", current->parent); + if (current->parent->hash == NULL || current->parent->hash->key == NULL) { + json_error(": without key\n"); } return json_parse(f, current->parent);