From f6b4e0e2e908101c7ccf5f42359b6f2ba935eb4a Mon Sep 17 00:00:00 2001 From: Christian Beer Date: Wed, 4 Nov 2015 10:11:07 +0100 Subject: [PATCH] Lib: prevent dereference of null value fixes CID 34508 found by Coverity --- lib/parse.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/parse.cpp b/lib/parse.cpp index d83fceb53c..ba841e806b 100644 --- a/lib/parse.cpp +++ b/lib/parse.cpp @@ -97,6 +97,7 @@ bool parse_str(const char* buf, const char* tag, char* dest, int destlen) { p = strstr(buf, tag); if (!p) return false; p = strchr(p, '>'); + if (!p) return false; p++; const char* q = strchr(p, '<'); if (!q) return false;