From: Ruediger Pluem Date: Fri, 10 Feb 2023 16:17:54 +0000 (+0000) Subject: * Optimize code: We know that we already have a valid encoding string, X-Git-Tag: 2.5.0-alpha2-ci-test-only~112 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7e5010b3cbfb25f5347ac888bf8961e41556b8f1;p=thirdparty%2Fapache%2Fhttpd.git * Optimize code: We know that we already have a valid encoding string, because we just decoded it. Hence just copy what we have instead of redoing it. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1907565 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/proxy/proxy_util.c b/modules/proxy/proxy_util.c index e4d9df9c486..3dacec38ee2 100644 --- a/modules/proxy/proxy_util.c +++ b/modules/proxy/proxy_util.c @@ -261,12 +261,13 @@ PROXY_DECLARE(char *)ap_proxy_canonenc(apr_pool_t *p, const char *x, int len, return NULL; } ch = ap_proxy_hex2c(&x[i + 1]); - i += 2; if (ch != 0 && strchr(reserved, ch)) { /* keep it encoded */ - ap_proxy_c2hex(ch, &y[j]); - j += 2; + y[j++] = x[i++]; + y[j++] = x[i++]; + y[j] = x[i]; continue; } + i += 2; } /* recode it, if necessary */ if (!apr_isalnum(ch) && !strchr(allowed, ch)) {