From: André Malo Date: Sun, 23 Feb 2003 22:04:23 +0000 (+0000) Subject: guess, what happens, when l == 0 X-Git-Tag: pre_ajp_proxy~2088 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=73bb5423fc296c09ce3099dd63ec49d7492882fc;p=apache guess, what happens, when l == 0 theoretical case, maybe ... git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@98773 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/mappers/mod_rewrite.c b/modules/mappers/mod_rewrite.c index 78a271c68d..7bfec784bd 100644 --- a/modules/mappers/mod_rewrite.c +++ b/modules/mappers/mod_rewrite.c @@ -4013,7 +4013,7 @@ static char *subst_prefix_path(request_rec *r, char *input, char *match, /* first create a match string which always has a trailing slash */ l = apr_cpystrn(matchbuf, match, sizeof(matchbuf) - 1) - matchbuf; - if (matchbuf[l-1] != '/') { + if (!l || matchbuf[l-1] != '/') { matchbuf[l] = '/'; matchbuf[l+1] = '\0'; l++; @@ -4025,7 +4025,7 @@ static char *subst_prefix_path(request_rec *r, char *input, char *match, /* and now add the base-URL as replacement prefix */ l = apr_cpystrn(substbuf, subst, sizeof(substbuf) - 1) - substbuf; - if (substbuf[l-1] != '/') { + if (!l || substbuf[l-1] != '/') { substbuf[l] = '/'; substbuf[l+1] = '\0'; l++;