(backport fix for PR18170)
Submitted by: Peter Mayne <PeterMayne@SPAM_SUX.ap.spherion.com>
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/APACHE_2_0_BRANCH@99445
13f79535-47bb-0310-9956-
ffa450edef68
APACHE 2.0 STATUS: -*-text-*-
-Last modified at [$Date: 2003/04/17 21:08:58 $]
+Last modified at [$Date: 2003/04/18 20:30:41 $]
Release:
corresponding to mpm_common.xml if that isn't something you're
comfortable with doing)
- * ap_get_mime_headers_core: alloc space for null terminator
- while folding
- server/protocol.c r1.128
- +1: gregames, jerenkrantz, trawick
-
CURRENT RELEASE NOTES:
* Backwards compatibility is expected of future Apache 2.0 releases,
* doing O(n) allocs and using O(n^2) space for
* continuations that span many many lines.
*/
- if (last_len + len > alloc_len) {
+ apr_size_t fold_len = last_len + len + 1; /* trailing null */
+ if (fold_len > alloc_len) {
char *fold_buf;
alloc_len += alloc_len;
- if (last_len + len > alloc_len) {
- alloc_len = last_len + len;
+ if (fold_len > alloc_len) {
+ alloc_len = fold_len;
}
fold_buf = (char *)apr_palloc(r->pool, alloc_len);
memcpy(fold_buf, last_field, last_len);