Commit 0d1550e7 authored by Christophe Jaillet's avatar Christophe Jaillet
Browse files

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
parent d1c39f0c
Loading
Loading
Loading
Loading
+4 −0
Changes for server/util.c: 4 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -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, '%');