summaryrefslogtreecommitdiffstats
path: root/grammar
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2013-11-19 10:39:21 +0100
committerRainer Gerhards <rgerhards@adiscon.com>2013-11-19 10:39:21 +0100
commitde652e16a83e8e53f63b81caa0bcc0d7fbc04263 (patch)
treec58c1323886ab08cc589188e8e5a3c227c28b700 /grammar
parent2666c6d71c4761d6fc01ff1647d5774d2cea02dc (diff)
downloadrsyslog-de652e16a83e8e53f63b81caa0bcc0d7fbc04263.tar.gz
rsyslog-de652e16a83e8e53f63b81caa0bcc0d7fbc04263.tar.bz2
rsyslog-de652e16a83e8e53f63b81caa0bcc0d7fbc04263.zip
bugfix: segfault on startup when certain script constructs are used
e.g. "if not $msg ..."
Diffstat (limited to 'grammar')
-rw-r--r--grammar/rainerscript.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/grammar/rainerscript.c b/grammar/rainerscript.c
index a1de6442..25d9c9a4 100644
--- a/grammar/rainerscript.c
+++ b/grammar/rainerscript.c
@@ -2737,6 +2737,9 @@ cnfexprOptimize_CMP_severity_facility(struct cnfexpr *expr)
{
struct cnffunc *func;
+ if(expr->l->nodetype != 'V')
+ FINALIZE;
+
if(!strcmp("$syslogseverity", ((struct cnfvar*)expr->l)->name)) {
if(expr->r->nodetype == 'N') {
int sev = (int) ((struct cnfnumval*)expr->r)->val;
@@ -2766,6 +2769,7 @@ cnfexprOptimize_CMP_severity_facility(struct cnfexpr *expr)
}
}
}
+finalize_it:
return expr;
}