httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mar...@apache.org
Subject cvs commit: apache-1.3/src/support ab.c
Date Sun, 06 Jul 2003 17:52:27 GMT
martin      2003/07/06 10:52:27

  Modified:    src      CHANGES
               src/support ab.c
  Log:
  Backport ab NULL-pointer issue fix from apache-2.1
  
  Revision  Changes    Path
  1.1897    +3 -0      apache-1.3/src/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/apache-1.3/src/CHANGES,v
  retrieving revision 1.1896
  retrieving revision 1.1897
  diff -u -u -r1.1896 -r1.1897
  --- CHANGES	28 May 2003 23:03:39 -0000	1.1896
  +++ CHANGES	6 Jul 2003 17:52:26 -0000	1.1897
  @@ -1,5 +1,8 @@
   Changes with Apache 1.3.28
   
  +  *) Fix NULL-pointer issue in ab when parsing an incomplete or non-HTTP
  +     response. PR 21085. [Glenn Nielsen <glenn@apache.org>, André Malo]
  +
     *) Removed BIND_NOSTART from HP/UX shl_load() logic for loadable
        Apache modules, so that statics are initialized when the module
        is loaded (especially critical for c++ modules on HPUX.)
  
  
  
  1.69      +10 -4     apache-1.3/src/support/ab.c
  
  Index: ab.c
  ===================================================================
  RCS file: /home/cvs/apache-1.3/src/support/ab.c,v
  retrieving revision 1.68
  retrieving revision 1.69
  diff -u -u -r1.68 -r1.69
  --- ab.c	3 Feb 2003 17:13:36 -0000	1.68
  +++ ab.c	6 Jul 2003 17:52:27 -0000	1.69
  @@ -1098,8 +1098,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