From: Christophe Jaillet Date: Fri, 17 Aug 2018 16:39:04 +0000 (+0000) Subject: Fix a cppcheck warning. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7f558e5b7635fc12eb8f96640bf2cbb16c0292b3;p=apache Fix a cppcheck warning. 'ap_unescape_urlencoded()' suggests that NULL can be passed to 'unescape_url()'. So avoid a potential 'strchr(NULL, ...)' which is an undefined behavior. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1838270 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/server/util.c b/server/util.c index 8e71d45d14..0ef1a74968 100644 --- a/server/util.c +++ b/server/util.c @@ -1794,6 +1794,10 @@ static int unescape_url(char *url, const char *forbid, const char *reserved) badesc = 0; badpath = 0; + + if (url == NULL) { + return OK; + } /* Initial scan for first '%'. Don't bother writing values before * seeing a '%' */ y = strchr(url, '%');