mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-02 22:46:30 +02:00
* iobuf.c (block_filter): Properly handle a partial body stream that ends
with a 5-byte length that happens to be zero.
This commit is contained in:
parent
e38ea662fa
commit
0a05d98b8b
2 changed files with 13 additions and 1 deletions
|
@ -1,5 +1,6 @@
|
|||
/* iobuf.c - file handling
|
||||
* Copyright (C) 1998, 1999, 2000, 2001, 2003 Free Software Foundation, Inc.
|
||||
* Copyright (C) 1998, 1999, 2000, 2001, 2003,
|
||||
* 2004 Free Software Foundation, Inc.
|
||||
*
|
||||
* This file is part of GnuPG.
|
||||
*
|
||||
|
@ -666,6 +667,12 @@ block_filter(void *opaque, int control, IOBUF chain, byte *buf, size_t *ret_len)
|
|||
}
|
||||
a->size |= c;
|
||||
a->partial = 2;
|
||||
if( !a->size ) {
|
||||
a->eof = 1;
|
||||
if( !n )
|
||||
rc = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else { /* next partial body length */
|
||||
a->size = 1 << (c & 0x1f);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue