summaryrefslogtreecommitdiffstats
path: root/runtime/msg.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2013-10-24 16:06:05 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2013-10-24 16:06:05 +0200
commit8443e8c2d7c1f5d82d9bd678c634ba7d562e1f63 (patch)
treeda7b0a2a9a23d32aa966aeaf4113aa12804ebd43 /runtime/msg.c
parenta8ac45583ec470acc68f140bb68f4ec7d3ccac55 (diff)
parent3a2a5442d93c8f994d8a274acb604c156a059e5e (diff)
downloadrsyslog-8443e8c2d7c1f5d82d9bd678c634ba7d562e1f63.tar.gz
rsyslog-8443e8c2d7c1f5d82d9bd678c634ba7d562e1f63.tar.bz2
rsyslog-8443e8c2d7c1f5d82d9bd678c634ba7d562e1f63.zip
Merge branch 'master' into master-var-refactor
Diffstat (limited to 'runtime/msg.c')
-rw-r--r--runtime/msg.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/runtime/msg.c b/runtime/msg.c
index 895dbeb6..7e01b185 100644
--- a/runtime/msg.c
+++ b/runtime/msg.c
@@ -3922,6 +3922,12 @@ msgAddJSON(msg_t *pM, uchar *name, struct json_object *json)
}
leaf = jsonPathGetLeaf(name, ustrlen(name));
CHKiRet(jsonPathFindParent(*pjroot, name, leaf, &parent, 1));
+ if (json_object_get_type(parent) != json_type_object) {
+ DBGPRINTF("msgAddJSON: not a container in json path,"
+ "name is '%s'\n", name);
+ json_object_put(json);
+ ABORT_FINALIZE(RS_RET_INVLD_SETOP);
+ }
leafnode = json_object_object_get(parent, (char*)leaf);
if(leafnode == NULL) {
json_object_object_add(parent, (char*)leaf, json);