summaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorChristophe Jaillet <jailletc36@apache.org>2018-08-17 18:39:04 +0200
committerChristophe Jaillet <jailletc36@apache.org>2018-08-17 18:39:04 +0200
commit7f558e5b7635fc12eb8f96640bf2cbb16c0292b3 (patch)
tree5832e163f77b7d3fe80c0a20a6b8234f63f06a16 /server
parentuploading file to keep the ongoing changes (diff)
downloadapache2-7f558e5b7635fc12eb8f96640bf2cbb16c0292b3.tar.xz
apache2-7f558e5b7635fc12eb8f96640bf2cbb16c0292b3.zip
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
Diffstat (limited to 'server')
-rw-r--r--server/util.c4
1 files changed, 4 insertions, 0 deletions
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, '%');