You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by sf...@apache.org on 2009/10/18 21:02:20 UTC
svn commit: r826497 - in /httpd/httpd/trunk: CHANGES support/ab.c
Author: sf
Date: Sun Oct 18 19:02:20 2009
New Revision: 826497
URL: http://svn.apache.org/viewvc?rev=826497&view=rev
Log:
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
Modified:
httpd/httpd/trunk/CHANGES
httpd/httpd/trunk/support/ab.c
Modified: httpd/httpd/trunk/CHANGES
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/CHANGES?rev=826497&r1=826496&r2=826497&view=diff
==============================================================================
--- httpd/httpd/trunk/CHANGES [utf-8] (original)
+++ httpd/httpd/trunk/CHANGES [utf-8] Sun Oct 18 19:02:20 2009
@@ -10,6 +10,9 @@
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]
Modified: httpd/httpd/trunk/support/ab.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/support/ab.c?rev=826497&r1=826496&r2=826497&view=diff
==============================================================================
--- httpd/httpd/trunk/support/ab.c (original)
+++ httpd/httpd/trunk/support/ab.c Sun Oct 18 19:02:20 2009
@@ -1593,7 +1593,14 @@
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) {