]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Fix crash, when out of memory.
authorAndré Malo <nd@apache.org>
Sat, 28 Aug 2004 16:20:08 +0000 (16:20 +0000)
committerAndré Malo <nd@apache.org>
Sat, 28 Aug 2004 16:20:08 +0000 (16:20 +0000)
Submitted by: Reasoning report ID 29
Reviewed by: Erik Abele, Ian Holsman

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

STATUS
support/ab.c

diff --git a/STATUS b/STATUS
index dac975755dc0442de2ea3e4a777a45d6965a2873..1cbac78cd3d69219c092ff60170aa7f2cc130717 100644 (file)
--- a/STATUS
+++ b/STATUS
@@ -1,5 +1,5 @@
 APACHE 2.0 STATUS:                                              -*-text-*-
-Last modified at [$Date: 2004/08/28 16:11:42 $]
+Last modified at [$Date: 2004/08/28 16:20:08 $]
 
 Release:
 
@@ -262,25 +262,6 @@ PATCHES TO BACKPORT FROM 2.1
                  shows breakage on Solaris which can't -lcrypto -lssl without
                  the extra pkgconfig/openssl.pc Libs: * foo }
 
-    * ab: catch out of memory (reasoning report ID 29)
-        support/ab.c: r1.125
-      +1: nd, erikabele, ianh
-       0: trawick, who is not about to stand in anybody's way on this,
-          but has two comments nonetheless:
-          a) with no abort function specified for the pools, this is just
-             one of many possible failures
-          b) my guess is that a heap shortage encountered by ab is
-             much more likely to be caused by an ab bug instead of by a
-             user setup error (ulimit) or system resource shortage...
-             is an error message better than a coredump in that case?
-
-          nd: hmm. This one is a pure (and obvious) malloc. Once we may
-              decide to use a pool-abort_fn; then the situation turns
-              around... :)
-              Yes, I think, a useful error message is better than
-              a coredump in this case.
-          jerenkrantz: Oh, bah.  Let 'em segfault.  Use flood!
-
     * mod_ssl: fix a link failure when the openssl-engine libraries are
       present but the engine headers are missing.
         modules/ssl/mod_ssl.c: r1.87
index 41fe12f289b506ea1e471c7494d31cc47c1ff7c0..77020dd15c275999e74750dac1d0373cd74633ae 100644 (file)
@@ -1599,7 +1599,11 @@ static void test(void)
      * Combine headers and (optional) post file into one contineous buffer
      */
     if (posting == 1) {
-       char *buff = (char *) malloc(postlen + reqlen + 1);
+       char *buff = malloc(postlen + reqlen + 1);
+        if (!buff) {
+            fprintf(stderr, "error creating request buffer: out of memory\n");
+            return;
+        }
        strcpy(buff, request);
        strcpy(buff + reqlen, postdata);
        request = buff;
@@ -1768,14 +1772,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.11 $> apache-2.0");
+       printf("This is ApacheBench, Version %s\n", AP_AB_BASEREVISION " <$Revision: 1.121.2.12 $> 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.11 $");
+       printf(" This is ApacheBench, Version %s <i>&lt;%s&gt;</i> apache-2.0<br>\n", AP_AB_BASEREVISION, "$Revision: 1.121.2.12 $");
        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");