diff options
author | Neal H. Walfield <[email protected]> | 2016-02-23 20:04:29 +0000 |
---|---|---|
committer | Neal H. Walfield <[email protected]> | 2016-02-23 20:04:29 +0000 |
commit | 8066f8a3470f9d2f3682a28641a7b09eca29a105 (patch) | |
tree | ee1c3f193773b34c67de994a6694ca5ed48c679d | |
parent | common: More accurately name function. (diff) | |
download | gnupg-8066f8a3470f9d2f3682a28641a7b09eca29a105.tar.gz gnupg-8066f8a3470f9d2f3682a28641a7b09eca29a105.zip |
common: Check for an error before reading.
* common/iobuf.c (iobuf_copy): If DEST has a pending error, don't
start copying.
--
Signed-off-by: Neal H. Walfield <[email protected]>
-rw-r--r-- | common/iobuf.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/common/iobuf.c b/common/iobuf.c index 6a9060a0e..1f2cd3f5d 100644 --- a/common/iobuf.c +++ b/common/iobuf.c @@ -2237,6 +2237,9 @@ iobuf_copy (iobuf_t dest, iobuf_t source) assert (source->use == IOBUF_INPUT || source->use == IOBUF_INPUT_TEMP); assert (dest->use == IOBUF_OUTPUT || source->use == IOBUF_OUTPUT_TEMP); + if (iobuf_error (dest)) + return -1; + temp = xmalloc (temp_size); while (1) { |