From 56dbc215666f0c0e5bdf316aab31db9b42b6920d Mon Sep 17 00:00:00 2001 From: Mihai Moldovan Date: Wed, 27 Dec 2017 19:49:25 +0100 Subject: nxcomp/src/Log.h: make sure we don't pass NULL pointers to strstr(). --- nxcomp/src/Log.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'nxcomp') diff --git a/nxcomp/src/Log.h b/nxcomp/src/Log.h index 9781ec8b2..d0ea627fa 100644 --- a/nxcomp/src/Log.h +++ b/nxcomp/src/Log.h @@ -509,7 +509,14 @@ bool has_newline(T value) template static bool has_newline(char *value) { - return strstr(value, "\n") != NULL; + if (value) + { + return strstr(value, "\n") != NULL; + } + else + { + return false; + } } template -- cgit v1.2.3