diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2012-09-12 15:33:13 +0200 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2012-09-12 15:33:13 +0200 |
commit | b4bc665643b707509ddbcbb9ca5726cd89350441 (patch) | |
tree | 976856db2bd718b53126b137c7918589470bda6b | |
parent | 0bcf72cde3be5c9ed8f59779fd4ff21ae5572451 (diff) | |
download | rsyslog-b4bc665643b707509ddbcbb9ca5726cd89350441.tar.gz rsyslog-b4bc665643b707509ddbcbb9ca5726cd89350441.tar.bz2 rsyslog-b4bc665643b707509ddbcbb9ca5726cd89350441.zip |
bugfix: abort when invalid property name was configured
-rw-r--r-- | grammar/rainerscript.c | 4 | ||||
-rw-r--r-- | runtime/ruleset.c | 4 |
2 files changed, 7 insertions, 1 deletions
diff --git a/grammar/rainerscript.c b/grammar/rainerscript.c index 30600ea3..d588ccc9 100644 --- a/grammar/rainerscript.c +++ b/grammar/rainerscript.c @@ -1609,13 +1609,15 @@ struct cnfstmt * cnfstmtNewPROPFILT(char *propfilt, struct cnfstmt *t_then) { struct cnfstmt* cnfstmt; + rsRetVal lRet; if((cnfstmt = cnfstmtNew(S_PROPFILT)) != NULL) { cnfstmt->printable = (uchar*)propfilt; cnfstmt->d.s_propfilt.t_then = t_then; cnfstmt->d.s_propfilt.propName = NULL; cnfstmt->d.s_propfilt.regex_cache = NULL; cnfstmt->d.s_propfilt.pCSCompValue = NULL; - DecodePropFilter((uchar*)propfilt, cnfstmt); + lRet = DecodePropFilter((uchar*)propfilt, cnfstmt); +dbgprintf("AAAA: DecodePropFilter returns %d\n", lRet); } return cnfstmt; } diff --git a/runtime/ruleset.c b/runtime/ruleset.c index 7b53fe3b..8310e70d 100644 --- a/runtime/ruleset.c +++ b/runtime/ruleset.c @@ -318,6 +318,9 @@ evalPROPFILT(struct cnfstmt *stmt, msg_t *pMsg) int bRet = 0; size_t propLen; + if(stmt->d.s_propfilt.propID == PROP_INVALID) + goto done; + pszPropVal = MsgGetProp(pMsg, NULL, stmt->d.s_propfilt.propID, stmt->d.s_propfilt.propName, &propLen, &pbMustBeFreed); @@ -390,6 +393,7 @@ evalPROPFILT(struct cnfstmt *stmt, msg_t *pMsg) /* cleanup */ if(pbMustBeFreed) free(pszPropVal); +done: return bRet; } |