Module: check_mk
Branch: master
Commit: 26c8f04ba1cccec96af13c9dfb355bdc58d34c11
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=26c8f04ba1ccce…
Author: Sven Panne <sp(a)mathias-kettner.de>
Date: Tue Jan 26 11:59:16 2016 +0100
Fixed crash when encountering incorrect And/Or query (found by scan-build).
---
livestatus/src/Query.cc | 1 +
1 file changed, 1 insertion(+)
diff --git a/livestatus/src/Query.cc b/livestatus/src/Query.cc
index 3aaf548..956889d 100644
--- a/livestatus/src/Query.cc
+++ b/livestatus/src/Query.cc
@@ -338,6 +338,7 @@ void Query::parseStatsAndOrLine(char *line, int andor)
if (!value) {
_output->setError(RESPONSE_CODE_INVALID_HEADER, "Missing value for
Stats%s: need non-zero integer number",
andor == ANDOR_OR ? "Or" : "And");
+ return;
}
int number = atoi(value);