]> granicus.if.org Git - apache/commitdiff
ab: Fix segfault in case the argument for -n is a very large number.
authorStefan Fritsch <sf@apache.org>
Sun, 18 Oct 2009 19:02:20 +0000 (19:02 +0000)
committerStefan Fritsch <sf@apache.org>
Sun, 18 Oct 2009 19:02:20 +0000 (19:02 +0000)
PR: 47178
Submitted by: Philipp Hagemeister <oss phihag.de>
Reviewed by: Stefan Fritsch

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

CHANGES
support/ab.c

diff --git a/CHANGES b/CHANGES
index 3cdccc9f281b42f13e97495b8139ae18120b3581..cee9e511029bcb8cb8ae6e3c668d7258f6a69c77 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -10,6 +10,9 @@ Changes with Apache 2.3.3
      mod_proxy_ftp: NULL pointer dereference on error paths.
      [Stefan Fritsch <sf fritsch.de>, Joe Orton]
 
+  *) ab: Fix segfault in case the argument for -n is a very large number.
+     PR 47178. [Philipp Hagemeister <oss phihag.de>]
+
   *) Allow ProxyPreserveHost to work in <Proxy> sections. PR 34901.
      [Stefan Fritsch]
 
index 5e5e334e4ed34fa38787012f6a868ab08f5f1af4..0baf8ce7aab83fd73e77692c9488965099bca1e0 100644 (file)
@@ -1593,7 +1593,14 @@ static void test(void)
 
     con = calloc(concurrency, sizeof(struct connection));
 
+    /*
+     * XXX: a way to calculate the stats without requiring O(requests) memory
+     * XXX: would be nice.
+     */
     stats = calloc(requests, sizeof(struct data));
+    if (stats == NULL) {
+       err("Cannot allocate memory for result statistics");
+    }
 
     if ((status = apr_pollset_create(&readbits, concurrency, cntxt,
                                      APR_POLLSET_NOCOPY)) != APR_SUCCESS) {