httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject svn commit: r1533440 - /httpd/httpd/trunk/modules/proxy/proxy_util.c
Date Fri, 18 Oct 2013 13:10:46 GMT
Author: jim
Date: Fri Oct 18 13:10:45 2013
New Revision: 1533440

URL: http://svn.apache.org/r1533440
Log:
RĂ¼diger and Yann suggestions

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=1533440&r1=1533439&r2=1533440&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/proxy/proxy_util.c (original)
+++ httpd/httpd/trunk/modules/proxy/proxy_util.c Fri Oct 18 13:10:45 2013
@@ -93,19 +93,20 @@ 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) {
+    /* special case handling */
+    if (!dlen) {
+        /* XXX: APR_ENOSPACE would be better */
+        return APR_EGENERAL;
+    }
+    if (!src) {
         *dst = '\0';
         return APR_SUCCESS;
     }
     thenil = apr_cpystrn(dst, src, dlen);
     thelen = thenil - dst;
-    /* Assume the typical case is smaller copying into bigger
-       so we have a fast return */
-    if ((thelen < dlen-1) || (src[thelen] == '\0')) {
+    if (src[thelen] == '\0') {
         return APR_SUCCESS;
     }
-    /* XXX: APR_ENOSPACE would be better */
     return APR_EGENERAL;
 }
 



Mime
View raw message