From 8066f8a3470f9d2f3682a28641a7b09eca29a105 Mon Sep 17 00:00:00 2001 From: "Neal H. Walfield" Date: Tue, 23 Feb 2016 21:04:29 +0100 Subject: [PATCH] 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 --- common/iobuf.c | 3 +++ 1 file changed, 3 insertions(+) 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) {