Lib: prevent dereference of null value

fixes CID 34508 found by Coverity
This commit is contained in:
Christian Beer 2015-11-04 10:11:07 +01:00
parent 8e8941c1bf
commit f6b4e0e2e9
1 changed files with 1 additions and 0 deletions

View File

@ -97,6 +97,7 @@ bool parse_str(const char* buf, const char* tag, char* dest, int destlen) {
p = strstr(buf, tag); p = strstr(buf, tag);
if (!p) return false; if (!p) return false;
p = strchr(p, '>'); p = strchr(p, '>');
if (!p) return false;
p++; p++;
const char* q = strchr(p, '<'); const char* q = strchr(p, '<');
if (!q) return false; if (!q) return false;