mirror of
git://git.gnupg.org/gnupg.git
synced 2025-04-17 15:44:34 +02:00
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 <neal@g10code.com>
This commit is contained in:
parent
903466e124
commit
8066f8a347
@ -2237,6 +2237,9 @@ iobuf_copy (iobuf_t dest, iobuf_t source)
|
|||||||
assert (source->use == IOBUF_INPUT || source->use == IOBUF_INPUT_TEMP);
|
assert (source->use == IOBUF_INPUT || source->use == IOBUF_INPUT_TEMP);
|
||||||
assert (dest->use == IOBUF_OUTPUT || source->use == IOBUF_OUTPUT_TEMP);
|
assert (dest->use == IOBUF_OUTPUT || source->use == IOBUF_OUTPUT_TEMP);
|
||||||
|
|
||||||
|
if (iobuf_error (dest))
|
||||||
|
return -1;
|
||||||
|
|
||||||
temp = xmalloc (temp_size);
|
temp = xmalloc (temp_size);
|
||||||
while (1)
|
while (1)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user