You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Ruediger Pluem <rp...@apache.org> on 2014/02/28 20:59:50 UTC

Re: svn commit: r1572655 - /httpd/httpd/trunk/modules/filters/mod_deflate.c


ylavic@apache.org wrote:
> Author: ylavic
> Date: Thu Feb 27 16:56:07 2014
> New Revision: 1572655
> 
> URL: http://svn.apache.org/r1572655
> Log:
> Commit 1 on 6 to fix reentrance (incomplete Zlib header or validation bytes) in mod_deflate's output and input filters.
> PR 46146 (patches from duplicated PR 55666)
> 
> Handle Zlib header buffering in the inflate output filter :
> - add the new deflate_ctx_t fields needed to re-enter the Zlib header parsing,
> - introduce the new consume_zlib_flags() function to parse/consume the ZLib flags (will be used by the other filters too),
> - use it to handle incomplete header in the output filter (deflate).
> 
> This alone fixes PR 55666, but the issue remains for PR 46146 (inflate/deflate input filters), hence the following patches.
> 
> Modified:
>     httpd/httpd/trunk/modules/filters/mod_deflate.c
> 
> Modified: httpd/httpd/trunk/modules/filters/mod_deflate.c
> URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/filters/mod_deflate.c?rev=1572655&r1=1572654&r2=1572655&view=diff
> ==============================================================================
> --- httpd/httpd/trunk/modules/filters/mod_deflate.c (original)
> +++ httpd/httpd/trunk/modules/filters/mod_deflate.c Thu Feb 27 16:56:07 2014


> +
> +        if (ctx->zlib_flags) {
> +            rv = consume_zlib_flags(ctx, &data, &len);
> +            if (rv == APR_SUCCESS) {
> +                ctx->zlib_flags = 0;
> +            }
> +            if (rv == APR_INCOMPLETE || !len) {

I guess (!len) should be enough here as if rv == APR_INCOMPLETE len == 0.


Regards

RĂ¼diger