From: André Malo Date: Wed, 23 Jul 2003 13:32:14 +0000 (+0000) Subject: don't compute the strlen of dconf->directory three times X-Git-Tag: pre_ajp_proxy~1386 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2f283a1dcd7dfc290cec4b1284892eb5af5de45c;p=apache don't compute the strlen of dconf->directory three times Submitted by: Justin git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@100744 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/mappers/mod_rewrite.c b/modules/mappers/mod_rewrite.c index 7e2ac2d851..88f951db5c 100644 --- a/modules/mappers/mod_rewrite.c +++ b/modules/mappers/mod_rewrite.c @@ -1449,7 +1449,7 @@ static int hook_fixup(request_rec *r) char *cp2; const char *ccp; char *prefix; - int l; + apr_size_t l; int rulestatus; int n; char *ofilename; @@ -1478,10 +1478,10 @@ static int hook_fixup(request_rec *r) * URL: http://localhost/foo and .htaccess is located in foo directory * Ignore such attempts, since they may lead to undefined behaviour. */ - if (r->filename && - strlen(r->filename) == strlen(dconf->directory) - 1 && - (dconf->directory)[strlen(dconf->directory) - 1] == '/' && - !strncmp(r->filename, dconf->directory, strlen(dconf->directory) - 1)) { + l = strlen(dconf->directory) - 1; + if (r->filename && strlen(r->filename) == l && + (dconf->directory)[l] == '/' && + !strncmp(r->filename, dconf->directory, l)) { return DECLINED; }