You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by ja...@apache.org on 2018/08/17 16:39:05 UTC
svn commit: r1838270 - /httpd/httpd/trunk/server/util.c
Author: jailletc36
Date: Fri Aug 17 16:39:04 2018
New Revision: 1838270
URL: http://svn.apache.org/viewvc?rev=1838270&view=rev
Log:
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.
Modified:
httpd/httpd/trunk/server/util.c
Modified: httpd/httpd/trunk/server/util.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/util.c?rev=1838270&r1=1838269&r2=1838270&view=diff
==============================================================================
--- httpd/httpd/trunk/server/util.c (original)
+++ httpd/httpd/trunk/server/util.c Fri Aug 17 16:39:04 2018
@@ -1794,6 +1794,10 @@ static int unescape_url(char *url, const
badesc = 0;
badpath = 0;
+
+ if (url == NULL) {
+ return OK;
+ }
/* Initial scan for first '%'. Don't bother writing values before
* seeing a '%' */
y = strchr(url, '%');