]> granicus.if.org Git - apache/commitdiff
uh, oh. Fix possible 1-byte buffer overflow.
authorAndre Malo <nd@apache.org>
Sun, 23 Feb 2003 00:05:32 +0000 (00:05 +0000)
committerAndre Malo <nd@apache.org>
Sun, 23 Feb 2003 00:05:32 +0000 (00:05 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@98769 13f79535-47bb-0310-9956-ffa450edef68

modules/mappers/mod_rewrite.c

index 8ab25ea15729410d46a8046491d146aab9a0dd92..78a271c68d5c035933e0e2b74a884193db1e9318 100644 (file)
@@ -4012,7 +4012,7 @@ static char *subst_prefix_path(request_rec *r, char *input, char *match,
     output = input;
 
     /* first create a match string which always has a trailing slash */
-    l = apr_cpystrn(matchbuf, match, sizeof(matchbuf)) - matchbuf;
+    l = apr_cpystrn(matchbuf, match, sizeof(matchbuf) - 1) - matchbuf;
     if (matchbuf[l-1] != '/') {
        matchbuf[l] = '/';
        matchbuf[l+1] = '\0';
@@ -4024,7 +4024,7 @@ static char *subst_prefix_path(request_rec *r, char *input, char *match,
         output = apr_pstrdup(r->pool, output+l);
 
         /* and now add the base-URL as replacement prefix */
-        l = apr_cpystrn(substbuf, subst, sizeof(substbuf)) - substbuf;
+        l = apr_cpystrn(substbuf, subst, sizeof(substbuf) - 1) - substbuf;
         if (substbuf[l-1] != '/') {
            substbuf[l] = '/';
            substbuf[l+1] = '\0';