Blame SOURCES/rsyslog-8.24.0-rhbz1427821-str2num-emty-string-handle.patch

a856a8
@@ -, +, @@ 
a856a8
---
a856a8
 grammar/rainerscript.c | 8 ++++++++
a856a8
 1 file changed, 8 insertions(+)
a856a8
--- a/grammar/rainerscript.c	
a856a8
+++ a/grammar/rainerscript.c	
a856a8
@@ -1276,6 +1276,13 @@ str2num(es_str_t *s, int *bSuccess)
a856a8
 	int64_t num = 0;
a856a8
 	const uchar *const c = es_getBufAddr(s);
a856a8
 
a856a8
+	if(s->lenStr == 0) {
a856a8
+		DBGPRINTF("rainerscript: str2num: strlen == 0; invalid input (no string)\n");
a856a8
+		if(bSuccess != NULL) {
a856a8
+			*bSuccess = 1;
a856a8
+		}
a856a8
+		goto done;
a856a8
+	}
a856a8
 	if(c[0] == '-') {
a856a8
 		neg = -1;
a856a8
 		i = -1;
a856a8
@@ -1290,6 +1297,7 @@ str2num(es_str_t *s, int *bSuccess)
a856a8
 	num *= neg;
a856a8
 	if(bSuccess != NULL)
a856a8
 		*bSuccess = (i == s->lenStr) ? 1 : 0;
a856a8
+done:
a856a8
 	return num;
a856a8
 }
a856a8