From 7f558e5b7635fc12eb8f96640bf2cbb16c0292b3 Mon Sep 17 00:00:00 2001 From: Christophe Jaillet Date: Fri, 17 Aug 2018 16:39:04 +0000 Subject: [PATCH] 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 --- server/util.c | 4 ++++ 1 file changed, 4 insertions(+) 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, '%'); -- 2.50.1