From: Amos Jeffries Date: Fri, 25 Jan 2013 23:44:49 +0000 (-0700) Subject: Fix NULL-dereference added in rev.12611 X-Git-Tag: SQUID_3_4_0_1~345 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=925a2a9f424a196bd0ef03d22b7d594d2a1b9889;p=thirdparty%2Fsquid.git Fix NULL-dereference added in rev.12611 * strto*() may be called without a value parameter when used simply to verify the content of a string is a valid conversion. Detected by Coverity Scan. Issue 970939. --- diff --git a/compat/xstrto.cc b/compat/xstrto.cc index 7dd72a8e3d..1fffd5412a 100644 --- a/compat/xstrto.cc +++ b/compat/xstrto.cc @@ -85,11 +85,12 @@ xstrtoui(const char *s, char **end, unsigned int *value, bool ret; ret = xstrtoul(s, end, &v, min, max); - if (value != NULL) + if (value != NULL) { *value = v; - if (v != static_cast(*value)) { - return false; + if (v != static_cast(*value)) { + return false; + } } return ret;