httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jor...@apache.org
Subject cvs commit: httpd-2.0/server protocol.c
Date Tue, 21 Sep 2004 21:07:24 GMT
jorton      2004/09/21 14:07:24

  Modified:    server   protocol.c
  Log:
  * server/protocol.c (ap_rgetline_core): Never NUL terminate at
  (*s)[-1] for caller-supplied *s.
  
  Submitted by: Rici Lake <ricilake speedy.com.pe>
  
  Revision  Changes    Path
  1.153     +3 -3      httpd-2.0/server/protocol.c
  
  Index: protocol.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/protocol.c,v
  retrieving revision 1.152
  retrieving revision 1.153
  diff -d -w -u -r1.152 -r1.153
  --- protocol.c	13 Sep 2004 15:34:59 -0000	1.152
  +++ protocol.c	21 Sep 2004 21:07:23 -0000	1.153
  @@ -252,12 +252,12 @@
               if (n < bytes_handled + len) {
                   *read = bytes_handled;
                   if (*s) {
  -                    /* ensure this string is terminated */
  -                    if (bytes_handled < n) {
  +                    /* ensure this string is NUL terminated */
  +                    if (bytes_handled > 0) {
                           (*s)[bytes_handled-1] = '\0';
                       }
                       else {
  -                        (*s)[n-1] = '\0';
  +                        (*s)[0] = '\0';
                       }
                   }
                   return APR_ENOSPC;
  
  
  

Mime
View raw message