diff options
author | David Shaw <[email protected]> | 2004-03-01 21:48:32 +0000 |
---|---|---|
committer | David Shaw <[email protected]> | 2004-03-01 21:48:32 +0000 |
commit | 0a05d98b8b5a43ff53dcd77d91270ae7297ec2b7 (patch) | |
tree | d0ebe02bfd34e9d1e52e043f2416053a271e5771 | |
parent | * unsetenv.c: Fixed debugging typo. (diff) | |
download | gnupg-0a05d98b8b5a43ff53dcd77d91270ae7297ec2b7.tar.gz gnupg-0a05d98b8b5a43ff53dcd77d91270ae7297ec2b7.zip |
* iobuf.c (block_filter): Properly handle a partial body stream that ends
with a 5-byte length that happens to be zero.
Diffstat (limited to '')
-rw-r--r-- | util/ChangeLog | 5 | ||||
-rw-r--r-- | util/iobuf.c | 9 |
2 files changed, 13 insertions, 1 deletions
diff --git a/util/ChangeLog b/util/ChangeLog index d9f82d6d9..3bd5c2fe7 100644 --- a/util/ChangeLog +++ b/util/ChangeLog @@ -1,3 +1,8 @@ +2004-03-01 David Shaw <[email protected]> + + * iobuf.c (block_filter): Properly handle a partial body stream + that ends with a 5-byte length that happens to be zero. + 2004-02-28 David Shaw <[email protected]> * unsetenv.c: Fixed debugging typo. diff --git a/util/iobuf.c b/util/iobuf.c index 3d55349b8..aae03c9ea 100644 --- a/util/iobuf.c +++ b/util/iobuf.c @@ -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); |