mirror of
git://git.gnupg.org/gnupg.git
synced 2025-01-03 12:11:33 +01:00
Fix bug#1011.
This commit is contained in:
parent
983f91937c
commit
34db1110fc
@ -1,3 +1,8 @@
|
||||
2009-09-03 Werner Koch <wk@g10code.com>
|
||||
|
||||
* compress-bz2.c (do_uncompress): Detect unexpected EOF. Fix
|
||||
bug#1011.
|
||||
|
||||
2009-08-26 Werner Koch <wk@g10code.com>
|
||||
|
||||
* keyedit.c (menu_revsig): Check for signature right away. Fix
|
||||
@ -980,7 +985,6 @@
|
||||
(main): Replace iobuf_translate_file_handle by
|
||||
translate_sys2libc_fd.
|
||||
|
||||
|
||||
2007-06-21 Werner Koch <wk@g10code.com>
|
||||
|
||||
* main.h: Include util.h.
|
||||
|
@ -118,6 +118,7 @@ do_uncompress( compress_filter_context_t *zfx, bz_stream *bzs,
|
||||
size_t n;
|
||||
int nread, count;
|
||||
int refill = !bzs->avail_in;
|
||||
int eofseen = 0;
|
||||
|
||||
if( DBG_FILTER )
|
||||
log_debug("begin bzDecompress: avail_in=%u, avail_out=%u, inbuf=%u\n",
|
||||
@ -132,11 +133,15 @@ do_uncompress( compress_filter_context_t *zfx, bz_stream *bzs,
|
||||
bzs->next_in = zfx->inbuf;
|
||||
count = zfx->inbufsize - n;
|
||||
nread = iobuf_read( a, zfx->inbuf + n, count );
|
||||
if( nread == -1 ) nread = 0;
|
||||
if( nread == -1 )
|
||||
{
|
||||
eofseen = 1;
|
||||
nread = 0;
|
||||
}
|
||||
n += nread;
|
||||
bzs->avail_in = n;
|
||||
}
|
||||
|
||||
if (!eofseen)
|
||||
refill = 1;
|
||||
|
||||
if( DBG_FILTER )
|
||||
@ -151,6 +156,13 @@ do_uncompress( compress_filter_context_t *zfx, bz_stream *bzs,
|
||||
rc = -1; /* eof */
|
||||
else if( zrc != BZ_OK && zrc != BZ_PARAM_ERROR )
|
||||
log_fatal("bz2lib inflate problem: rc=%d\n", zrc );
|
||||
else if (zrc == BZ_OK && eofseen
|
||||
&& !bzs->avail_in && bzs->avail_out > 0)
|
||||
{
|
||||
log_error ("unexpected EOF in bz2lib\n");
|
||||
rc = GPG_ERR_BAD_DATA;
|
||||
break;
|
||||
}
|
||||
}
|
||||
while( bzs->avail_out && zrc != BZ_STREAM_END && zrc != BZ_PARAM_ERROR );
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user