mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-02 22:46:30 +02:00
gpg: Fix assertion failure due to errors in encrypt_filter.
* common/iobuf.c (iobuf_copy): Use log_assert. Explicitly cast error
return value.
* g10/build-packet.c (do_plaintext): Check for iobuf_copy error.
* g10/encrypt.c (encrypt_filter): Immediately set header_okay.
--
Fixes-commit: 8066f8a347
which caused the assertion failure on error.
The second fix avoids repeated error message about non-compliant keys.
GnuPG-bug-id: 6174
This commit is contained in:
parent
f88cb12f8e
commit
aa0c942521
3 changed files with 9 additions and 6 deletions
|
@ -2201,7 +2201,7 @@ iobuf_temp_to_buffer (iobuf_t a, byte * buffer, size_t buflen)
|
|||
|
||||
/* Copies the data from the input iobuf SOURCE to the output iobuf
|
||||
DEST until either an error is encountered or EOF is reached.
|
||||
Returns the number of bytes copies. */
|
||||
Returns the number of bytes copies or (size_t)(-1) on error. */
|
||||
size_t
|
||||
iobuf_copy (iobuf_t dest, iobuf_t source)
|
||||
{
|
||||
|
@ -2214,11 +2214,11 @@ iobuf_copy (iobuf_t dest, iobuf_t source)
|
|||
size_t max_read = 0;
|
||||
int err;
|
||||
|
||||
assert (source->use == IOBUF_INPUT || source->use == IOBUF_INPUT_TEMP);
|
||||
assert (dest->use == IOBUF_OUTPUT || source->use == IOBUF_OUTPUT_TEMP);
|
||||
log_assert (source->use == IOBUF_INPUT || source->use == IOBUF_INPUT_TEMP);
|
||||
log_assert (dest->use == IOBUF_OUTPUT || source->use == IOBUF_OUTPUT_TEMP);
|
||||
|
||||
if (iobuf_error (dest))
|
||||
return -1;
|
||||
return (size_t)(-1);
|
||||
|
||||
temp = xmalloc (temp_size);
|
||||
while (1)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue