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 2013/05/22 21:45:24 UTC

svn commit: r1485379 - /httpd/httpd/trunk/server/util.c

Author: jailletc36
Date: Wed May 22 19:45:23 2013
New Revision: 1485379

URL: http://svn.apache.org/r1485379
Log:
Revert change in order to apply a better solution.

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=1485379&r1=1485378&r2=1485379&view=diff
==============================================================================
--- httpd/httpd/trunk/server/util.c (original)
+++ httpd/httpd/trunk/server/util.c Wed May 22 19:45:23 2013
@@ -1910,26 +1910,12 @@ AP_DECLARE(char *) ap_escape_logitem(apr
     char *ret;
     unsigned char *d;
     const unsigned char *s;
-    apr_size_t length = 0;
 
     if (!str) {
         return NULL;
     }
 
-    /* First, compute the space needed for the escaped string.
-     * This could be tweaked a bit for '\b', '\n'... These characters
-     * should not be common, so do not bother. */
-    s = (const unsigned char *)str;
-    for (; *s; ++s) {
-        if (TEST_CHAR(*s, T_ESCAPE_LOGITEM)) {
-            length += 4;        /* for '\\' + c2x() */
-        }
-        else {
-            length++;
-        }
-    }
-    
-    ret = apr_palloc(p, length + 1);
+    ret = apr_palloc(p, 4 * strlen(str) + 1); /* Be safe */
     d = (unsigned char *)ret;
     s = (const unsigned char *)str;
     for (; *s; ++s) {