doubleing the size of the new buffer each time.
PR: 48024
Submitted by: Basant Kumar Kukreja <basant.kukreja sun.com>
Reviewed by: rpluem
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@826772
13f79535-47bb-0310-9956-
ffa450edef68
mod_proxy_ftp: NULL pointer dereference on error paths.
[Stefan Fritsch <sf fritsch.de>, Joe Orton]
+ *) mod_sed: Reduce memory consumption when processing very long lines.
+ PR 48024 [Basant Kumar Kukreja <basant.kukreja sun.com>]
+
*) ab: Fix segfault in case the argument for -n is a very large number.
PR 47178. [Philipp Hagemeister <oss phihag.de>]
int spendsize = 0;
if (*cursize >= newsize)
return;
+ /* Avoid number of times realloc is called. It could cause huge memory
+ * requirement if line size is huge e.g 2 MB */
+ if (newsize < *cursize * 2) {
+ newsize = *cursize * 2;
+ }
+
/* Align it to 4 KB boundary */
newsize = (newsize + ((1 << 12) - 1)) & ~((1 << 12) -1);
newbuffer = apr_pcalloc(pool, newsize);