1
0
mirror of https://github.com/apache/httpd.git synced 2025-08-08 15:02:10 +03:00

Don't assume that the byterange filter will always be called more than

once.  It is perfectly legal to call the byterange filter one time,
with all the data.  Without this patch, that case will seg fault.
Submitted by:	Ryan Morgan <rmogran@covalent.net>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88320 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Ryan Bloom
2001-02-25 16:57:08 +00:00
parent c200a5ea11
commit c03d4e0715
2 changed files with 15 additions and 5 deletions

View File

@@ -280,10 +280,14 @@ AP_CORE_DECLARE_NONSTD(apr_status_t) ap_byterange_filter(
NULL);
ap_xlate_proto_to_ascii(bound_head, strlen(bound_head));
/* concat the passed brigade with our saved brigade */
APR_BRIGADE_CONCAT(ctx->bb, bb);
bb = ctx->bb;
ctx->bb = NULL; /* ### strictly necessary? call brigade_destroy? */
/* If we have a saved brigade from a previous run, concat the passed
* brigade with our saved brigade. Otherwise just continue.
*/
if (ctx->bb) {
APR_BRIGADE_CONCAT(ctx->bb, bb);
bb = ctx->bb;
ctx->bb = NULL; /* ### strictly necessary? call brigade_destroy? */
}
/* It is possible that we won't have a content length yet, so we have to
* compute the length before we can actually do the byterange work.