From: Bill Stoddard Date: Thu, 25 Mar 2004 02:20:27 +0000 (+0000) Subject: Can't assume the filepointer is really 0 when offset is 0. A handler can create briga... X-Git-Tag: 2.0.50~288 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=958e79de30d3fbfc4c80bca58776455d2740257f;p=thirdparty%2Fapache%2Fhttpd.git Can't assume the filepointer is really 0 when offset is 0. A handler can create brigades containing multiple file buckets with arbitrary offsets git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/APACHE_2_0_BRANCH@103147 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index 865d4b1e99c..6cbcae59be7 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,10 @@ Changes with Apache 2.0.50 + *) core_output_filter: Fix bug that could result in sending + garbage over the network when module handlers construct + bucket brigades containing multiple file buckets all referencing + the same open file descriptor. [Bojan Smojver] + *) Fix memory corruption problem with ap_custom_response() function. The core per-dir config would later point to request pool data that would be reused for different purposes on different requests. diff --git a/STATUS b/STATUS index d2616dea585..b0133586a68 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE 2.0 STATUS: -*-text-*- -Last modified at [$Date: 2004/03/25 02:07:27 $] +Last modified at [$Date: 2004/03/25 02:20:27 $] Release: @@ -77,14 +77,6 @@ PATCHES TO BACKPORT FROM 2.1 support/ab.c: r1.143 +1: jjclar - *) Bojan Smojver's fix to core_output_filter emulate_sendfile() - Fix bug that could result in sending garbage over the network - when module handlers construct bucket brigades containing - multiple file buckets all referencing the same open file - descriptor. - server/core.c?r1=1.268&r2=1.269 - +1: stoddard, rederpj, jwoolley - *) work around MSIE Digest auth bug - if AuthDigestEnableQueryStringHack is set in r->subprocess_env allow mismatched query strings to pass. PR: 27758 diff --git a/server/core.c b/server/core.c index fb0aac79932..72b30053762 100644 --- a/server/core.c +++ b/server/core.c @@ -2985,7 +2985,7 @@ static apr_status_t emulate_sendfile(core_net_rec *c, apr_file_t *fd, } /* Seek the file to 'offset' */ - if (offset != 0 && rv == APR_SUCCESS) { + if (offset >= 0 && rv == APR_SUCCESS) { rv = apr_file_seek(fd, APR_SET, &offset); }