diff options
author | bi <bisnard@antidot.net> | 2013-05-15 17:35:26 +0200 |
---|---|---|
committer | Emmanuele Bassi <ebassi@gnome.org> | 2013-12-02 11:18:51 +0000 |
commit | d82420c14b19f29a993b7754ff1128b3524c4ad7 (patch) | |
tree | 03966347d530427b57b1aa3bc4a01d1ce236b77d /json-glib/json-path.c | |
parent | e4a054484774fd0849ca18617b6e20d15964fdd8 (diff) | |
download | json-glib-d82420c14b19f29a993b7754ff1128b3524c4ad7.tar.gz |
Handle invalid path: invalid first character
Signed-off-by: Emmanuele Bassi <ebassi@gnome.org>
Conflicts:
json-glib/json-path.c
Diffstat (limited to 'json-glib/json-path.c')
-rw-r--r-- | json-glib/json-path.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/json-glib/json-path.c b/json-glib/json-path.c index e59a285..f829433 100644 --- a/json-glib/json-path.c +++ b/json-glib/json-path.c @@ -417,7 +417,7 @@ json_path_compile (JsonPath *path, { const char *p, *end_p; PathNode *root = NULL; - GList *nodes; + GList *nodes = NULL; g_return_val_if_fail (expression != NULL, FALSE); @@ -698,6 +698,14 @@ json_path_compile (JsonPath *path, break; default: + if (nodes == NULL) + { + g_set_error(error, JSON_PATH_ERROR, + JSON_PATH_ERROR_INVALID_QUERY, + _("Invalid first character '%c'"), + *p); + return FALSE; + } break; } |