]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Fix NULL-pointer issue in ab when parsing an incomplete or non-HTTP
authorAndré Malo <nd@apache.org>
Sat, 12 Jul 2003 12:44:11 +0000 (12:44 +0000)
committerAndré Malo <nd@apache.org>
Sat, 12 Jul 2003 12:44:11 +0000 (12:44 +0000)
response.

PR: 21085
Submitted by: Glenn Nielsen <glenn@apache.org>
Reviewed by:    Brian Pane, Erik Abele

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/APACHE_2_0_BRANCH@100559 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
STATUS
support/ab.c

diff --git a/CHANGES b/CHANGES
index df60e418ac24a910e6615895baeb03b79c92f697..b6f3f342ef28745867f3a4c46476a34ae929b669 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,5 +1,8 @@
 Changes with Apache 2.0.48
 
+  *) Fix NULL-pointer issue in ab when parsing an incomplete or non-HTTP
+     response. PR 21085. [Glenn Nielsen <glenn@apache.org>, André Malo]
+
   *) mod_rewrite: Perform child initialization on the rewrite log lock.
      This fixes a log corruption issue when flock-based serialization
      is used (e.g., FreeBSD).  [Jeff Trawick]
diff --git a/STATUS b/STATUS
index 2fed4a0e42c9b51149198bca9886cfa27e382db2..8ec9abc7fb4b1d4f324b0fa303d1ac6accef560e 100644 (file)
--- a/STATUS
+++ b/STATUS
@@ -1,5 +1,5 @@
 APACHE 2.0 STATUS:                                              -*-text-*-
-Last modified at [$Date: 2003/07/09 15:31:49 $]
+Last modified at [$Date: 2003/07/12 12:44:10 $]
 
 Release:
 
@@ -236,11 +236,6 @@ PATCHES TO PORT FROM 2.1
         config.layout: r1.22
       +1: nd, brianp, erikabele, kess
 
-    * ab: fix NULL-pointer issue when parsing incomplete response. PR 21085.
-      (2.0 + 1.3)
-        support/ab.c: r1.124
-      +1: nd, brianp, erikabele
-
     * ab: catch out of memory (reasoning report ID 29)
         support/ab.c: r1.125
       +1: nd, erikabele
index a83137bbe7cc862e7cd96cde8cf2651bd33a317e..fea3da3569a8f50266bae1d2b5476cb7d881379d 100644 (file)
@@ -1475,8 +1475,14 @@ static void read_connection(struct connection * c)
 
            /* 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)
@@ -1771,14 +1777,14 @@ static void test(void)
 static void copyright(void)
 {
     if (!use_html) {
-       printf("This is ApacheBench, Version %s\n", AP_AB_BASEREVISION " <$Revision: 1.121.2.1 $> apache-2.0");
+       printf("This is ApacheBench, Version %s\n", AP_AB_BASEREVISION " <$Revision: 1.121.2.2 $> apache-2.0");
        printf("Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/\n");
        printf("Copyright (c) 1998-2002 The Apache Software Foundation, http://www.apache.org/\n");
        printf("\n");
     }
     else {
        printf("<p>\n");
-       printf(" This is ApacheBench, Version %s <i>&lt;%s&gt;</i> apache-2.0<br>\n", AP_AB_BASEREVISION, "$Revision: 1.121.2.1 $");
+       printf(" This is ApacheBench, Version %s <i>&lt;%s&gt;</i> apache-2.0<br>\n", AP_AB_BASEREVISION, "$Revision: 1.121.2.2 $");
        printf(" Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/<br>\n");
        printf(" Copyright (c) 1998-2002 The Apache Software Foundation, http://www.apache.org/<br>\n");
        printf("</p>\n<p>\n");