From: Christophe Jaillet Date: Wed, 22 May 2013 19:45:23 +0000 (+0000) Subject: Revert change in order to apply a better solution. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=23c9c08da621e6ead821c52a1832f02c7f243066;p=thirdparty%2Fapache%2Fhttpd.git Revert change in order to apply a better solution. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1485379 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/server/util.c b/server/util.c index 9a795eac375..c696fb7350e 100644 --- a/server/util.c +++ b/server/util.c @@ -1910,26 +1910,12 @@ AP_DECLARE(char *) ap_escape_logitem(apr_pool_t *p, const char *str) 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) {