httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject svn commit: r1533100 - /httpd/httpd/trunk/modules/proxy/proxy_util.c
Date Thu, 17 Oct 2013 15:02:04 GMT
Author: jim
Date: Thu Oct 17 15:02:04 2013
New Revision: 1533100

URL: http://svn.apache.org/r1533100
Log:
ap_proxy_strncpy should correctly handle src being NULL.
Actually, apr_cpystrn() should as well...

Modified:
    httpd/httpd/trunk/modules/proxy/proxy_util.c

Modified: httpd/httpd/trunk/modules/proxy/proxy_util.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/proxy/proxy_util.c?rev=1533100&r1=1533099&r2=1533100&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/proxy/proxy_util.c (original)
+++ httpd/httpd/trunk/modules/proxy/proxy_util.c Thu Oct 17 15:02:04 2013
@@ -93,6 +93,11 @@ PROXY_DECLARE(apr_status_t) ap_proxy_str
     char *thenil;
     apr_size_t thelen;
 
+    /* special case: really  apr_cpystrn should handle src==NULL*/
+    if (!src && dlen) {
+        *dst = '\0';
+        return APR_SUCCESS;
+    }
     thenil = apr_cpystrn(dst, src, dlen);
     thelen = thenil - dst;
     /* Assume the typical case is smaller copying into bigger



Mime
View raw message