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-Tag: 2.5.0-alpha~5421 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7af3897b1632be810587dfe21866a9709eb0ce88;p=apache 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 9a795eac37..c696fb7350 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) {