aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeal H. Walfield <[email protected]>2016-02-23 20:04:29 +0000
committerNeal H. Walfield <[email protected]>2016-02-23 20:04:29 +0000
commit8066f8a3470f9d2f3682a28641a7b09eca29a105 (patch)
treeee1c3f193773b34c67de994a6694ca5ed48c679d
parentcommon: More accurately name function. (diff)
downloadgnupg-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.c3
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)
{