From ce650acf1fc32a20db50a996ecc3008f47b02188 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Tue, 19 Jan 1999 18:37:41 +0000 Subject: See ChangeLog: Tue Jan 19 19:34:58 CET 1999 Werner Koch --- g10/compress.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'g10/compress.c') diff --git a/g10/compress.c b/g10/compress.c index 5aad678d6..accca02cc 100644 --- a/g10/compress.c +++ b/g10/compress.c @@ -146,8 +146,14 @@ do_uncompress( compress_filter_context_t *zfx, z_stream *zs, if( !n ) zs->next_in = zfx->inbuf; for( p=zfx->inbuf+n; n < zfx->inbufsize; n++, p++ ) { - if( (c=iobuf_get(a)) == -1 ) - break; + if( (c=iobuf_get(a)) == -1 ) { + /* If we use the undocumented feature to suppress + * the zlib header, we have to give inflate an + * extra dummy byte to read */ + if( zfx->algo != 1 || zfx->algo1hack ) + break; + zfx->algo1hack = 1; + } *p = c & 0xff; } zs->avail_in = n; -- cgit v1.2.3