httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n.@apache.org
Subject cvs commit: httpd-2.0/modules/mappers mod_rewrite.c
Date Thu, 27 Feb 2003 03:41:42 GMT
nd          2003/02/26 19:41:42

  Modified:    modules/mappers Tag: APACHE_2_0_BRANCH mod_rewrite.c
  Log:
  be more careful when using limited buffers.
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.135.2.5 +4 -4      httpd-2.0/modules/mappers/mod_rewrite.c
  
  Index: mod_rewrite.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/mappers/mod_rewrite.c,v
  retrieving revision 1.135.2.4
  retrieving revision 1.135.2.5
  diff -u -r1.135.2.4 -r1.135.2.5
  --- mod_rewrite.c	22 Feb 2003 18:38:13 -0000	1.135.2.4
  +++ mod_rewrite.c	27 Feb 2003 03:41:41 -0000	1.135.2.5
  @@ -4012,8 +4012,8 @@
       output = input;
   
       /* first create a match string which always has a trailing slash */
  -    l = apr_cpystrn(matchbuf, match, sizeof(matchbuf)) - matchbuf;
  -    if (matchbuf[l-1] != '/') {
  +    l = apr_cpystrn(matchbuf, match, sizeof(matchbuf) - 1) - matchbuf;
  +    if (!l || matchbuf[l-1] != '/') {
          matchbuf[l] = '/';
          matchbuf[l+1] = '\0';
          l++;
  @@ -4024,8 +4024,8 @@
           output = apr_pstrdup(r->pool, output+l);
   
           /* and now add the base-URL as replacement prefix */
  -        l = apr_cpystrn(substbuf, subst, sizeof(substbuf)) - substbuf;
  -        if (substbuf[l-1] != '/') {
  +        l = apr_cpystrn(substbuf, subst, sizeof(substbuf) - 1) - substbuf;
  +        if (!l || substbuf[l-1] != '/') {
              substbuf[l] = '/';
              substbuf[l+1] = '\0';
              l++;
  
  
  

Mime
View raw message