From 8f932972c2b1b8e70f3f89737f2809e3bbc6cc3d Mon Sep 17 00:00:00 2001 From: Jan-Piet Mens Date: Wed, 2 Sep 2015 11:45:15 +0200 Subject: [PATCH] storage: make doubly sure we're handling a location _type --- storage.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/storage.c b/storage.c index 09ed20a..7a2005f 100644 --- a/storage.c +++ b/storage.c @@ -450,6 +450,15 @@ static JsonNode *line_to_location(char *line) return (NULL); } + if ((j = json_find_member(json, "_type")) == NULL) { + json_delete(json); + return (NULL); + } + if (j->tag != JSON_STRING || strcmp(j->string_, "location") != 0) { + json_delete(json); + return (NULL); + } + o = json_mkobject(); if (json_copy_to_object(o, json, FALSE) == FALSE) {