diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2012-09-10 15:39:27 +0200 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2012-09-10 15:39:27 +0200 |
commit | 96a6686b0b59ab99db557859fd64483de3aab8da (patch) | |
tree | f1c51142419d1154db5922f122eeb2cd5c312676 | |
parent | 38d3b04cd08119ce37dfee05e11e686ccc2bd4e7 (diff) | |
download | rsyslog-96a6686b0b59ab99db557859fd64483de3aab8da.tar.gz rsyslog-96a6686b0b59ab99db557859fd64483de3aab8da.tar.bz2 rsyslog-96a6686b0b59ab99db557859fd64483de3aab8da.zip |
bugfix: string-generating templates caused abort if CEE field could not be found
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | runtime/msg.c | 11 |
2 files changed, 16 insertions, 3 deletions
@@ -1,4 +1,12 @@ --------------------------------------------------------------------------- +Version 7.1.1 [devel] 2012-09-?? +- imuxsock now stores trusted properties by default in the CEE root + This was done in order to keep compatible with other implementations of + the lumberjack schema + Thanks to Miloslav Trmač for pointing to this. +- bugfix: string-generating templates caused abort if CEE field could not + be found +--------------------------------------------------------------------------- Version 7.1.0 [devel] 2012-09-06 - added support for hierarchical properties (CEE/lumberjack) - added pure JSON output plugin parameter passing mode diff --git a/runtime/msg.c b/runtime/msg.c index afc79042..f1f7997c 100644 --- a/runtime/msg.c +++ b/runtime/msg.c @@ -2434,10 +2434,15 @@ dbgprintf("AAAA: leaf '%s'\n", leaf); CHKiRet(jsonPathFindParent(pM, name, leaf, &parent, 1)); field = json_object_object_get(parent, (char*)leaf); } - *pRes = (uchar*) strdup(json_object_get_string(field)); + if(field == 0) { + *pRes = (uchar*) ""; + *pbMustBeFreed = 0; + } else { + *pRes = (uchar*) strdup(json_object_get_string(field)); dbgprintf("AAAA: json_object_get_string() returns '%s'\n", *pRes); - *buflen = (int) ustrlen(*pRes); - *pbMustBeFreed = 1; + *buflen = (int) ustrlen(*pRes); + *pbMustBeFreed = 1; + } finalize_it: free(name); |