summaryrefslogtreecommitdiffstats
path: root/support/ab.c
diff options
context:
space:
mode:
authorStefan Fritsch <sf@apache.org>2009-10-18 21:02:20 +0200
committerStefan Fritsch <sf@apache.org>2009-10-18 21:02:20 +0200
commit97944da68c7df26fa5da4a91a1559cb27edf4e8c (patch)
tree8380597ea71339c985b1a40d0dc971fcb35e5987 /support/ab.c
parentUpdate. (diff)
downloadapache2-97944da68c7df26fa5da4a91a1559cb27edf4e8c.tar.xz
apache2-97944da68c7df26fa5da4a91a1559cb27edf4e8c.zip
ab: Fix segfault in case the argument for -n is a very large number.
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
Diffstat (limited to 'support/ab.c')
-rw-r--r--support/ab.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/support/ab.c b/support/ab.c
index 5e5e334e4e..0baf8ce7aa 100644
--- a/support/ab.c
+++ b/support/ab.c
@@ -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) {