From cdb58f8d913dc47b01f61f5a72a83ce6aea26623 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Fri, 21 Aug 2009 15:13:47 +0200 Subject: bugfix: strings improperly reused ... resulting in some message properties be populated with strings from previous messages. This was caused by an improper predicate check. --- ChangeLog | 3 +++ runtime/prop.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index bde56d58..334fbad7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -8,6 +8,9 @@ Version 5.1.5 [DEVEL] (rgerhards), 2009-08-?? malformed, thus causing them to be treated as TAG (this was a regression introduced from the "rfc3164 strict" change in 4.5.0). Testbench has been updated to include a smaple message with a hostname containing a dash. +- bugfix: strings improperly reused, resulting in some message properties + be populated with strings from previous messages. This was caused by + an improper predicate check. --------------------------------------------------------------------------- Version 5.1.4 [DEVEL] (rgerhards), 2009-08-20 - legacy syslog parser changed so that it now accepts date stamps in diff --git a/runtime/prop.c b/runtime/prop.c index 804f3491..d188b2ed 100644 --- a/runtime/prop.c +++ b/runtime/prop.c @@ -174,7 +174,7 @@ rsRetVal CreateOrReuseStringProp(prop_t **ppThis, uchar *psz, int len) } else { /* already exists, check if we can re-use it */ GetString(*ppThis, &pszPrev, &lenPrev); - if(len != lenPrev && ustrcmp(psz, pszPrev)) { + if(len != lenPrev || ustrcmp(psz, pszPrev)) { /* different, need to discard old & create new one */ propDestruct(ppThis); CHKiRet(CreateStringProp(ppThis, psz, len)); -- cgit v1.2.3