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/support ab.c
Date Sun, 29 Jun 2003 17:41:56 GMT
nd          2003/06/29 10:41:56

  Modified:    .        CHANGES
               support  ab.c
  Log:
  Fix NULL-pointer issue in ab when parsing an incomplete or non-HTTP
  response.
  
  PR: 21085
  Submitted by:	Glenn Nielsen <glenn@apache.org>
  
  Revision  Changes    Path
  1.1206    +3 -0      httpd-2.0/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/CHANGES,v
  retrieving revision 1.1205
  retrieving revision 1.1206
  diff -u -r1.1205 -r1.1206
  --- CHANGES	29 Jun 2003 16:44:22 -0000	1.1205
  +++ CHANGES	29 Jun 2003 17:41:55 -0000	1.1206
  @@ -2,6 +2,9 @@
   
     [Remove entries to the current 2.0 section below, when backported]
   
  +  *) Fix NULL-pointer issue in ab when parsing an incomplete or non-HTTP
  +     response. PR 21085. [Glenn Nielsen <glenn@apache.org>, André Malo]
  +
     *) Added FreeBSD directory layout. PR 21100.
        [Sander Holthaus <info@orangexl.com>, André Malo]
   
  
  
  
  1.124     +10 -4     httpd-2.0/support/ab.c
  
  Index: ab.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/support/ab.c,v
  retrieving revision 1.123
  retrieving revision 1.124
  diff -u -r1.123 -r1.124
  --- ab.c	24 Jun 2003 23:09:59 -0000	1.123
  +++ ab.c	29 Jun 2003 17:41:56 -0000	1.124
  @@ -1484,8 +1484,14 @@
   
   	    /* check response code */
   	    part = strstr(c->cbuff, "HTTP");	/* really HTTP/1.x_ */
  -	    strncpy(respcode, (part + strlen("HTTP/1.x_")), 3);
  -	    respcode[3] = '\0';
  +            if (part && strlen(part) > strlen("HTTP/1.x_")) {
  +                strncpy(respcode, (part + strlen("HTTP/1.x_")), 3);
  +                respcode[3] = '\0';
  +            }
  +            else {
  +                strcpy(respcode, "500");
  +            }
  +
   	    if (respcode[0] != '2') {
   		err_response++;
   		if (verbosity >= 2)
  
  
  

Mime
View raw message