From: Stefan Fritsch Date: Sun, 18 Oct 2009 19:02:20 +0000 (+0000) Subject: ab: Fix segfault in case the argument for -n is a very large number. X-Git-Tag: 2.3.3~158 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=97944da68c7df26fa5da4a91a1559cb27edf4e8c;p=apache ab: Fix segfault in case the argument for -n is a very large number. PR: 47178 Submitted by: Philipp Hagemeister Reviewed by: Stefan Fritsch git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@826497 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index 3cdccc9f28..cee9e51102 100644 --- 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 , Joe Orton] + *) ab: Fix segfault in case the argument for -n is a very large number. + PR 47178. [Philipp Hagemeister ] + *) Allow ProxyPreserveHost to work in sections. PR 34901. [Stefan Fritsch] 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) {