summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorJussi Kivilinna <jussi.kivilinna@iki.fi>2022-03-07 19:54:34 +0100
committerJussi Kivilinna <jussi.kivilinna@iki.fi>2022-03-08 19:03:08 +0100
commit49c6e583945263497064109697237701977689c3 (patch)
treee5bf38dd097ae3a54927200bf2a20dd0a34a099c /common
parentiobuf: add zerocopy optimization for iobuf_write (diff)
downloadgnupg2-49c6e583945263497064109697237701977689c3.tar.xz
gnupg2-49c6e583945263497064109697237701977689c3.zip
gpg: fix --enarmor with zero length source file
* common/iobuf.c (filter_flush): Remove "src_len == 0" check. * g10/compress-bz2.c (do_compress): Exit early if flush not forced and input length is zero. * g10/compress.c (do_compress): Likewise. -- Remove "(src_len == 0)" check in filter_flush which was introduced to fix compress failure caused by zero length flush from iobuf_close. However this check broke enarmoring file with length of zero. Patch instead fixes zero length flush problem in compress filters. GnuPG-bug-id: T5828 Signed-off-by: Jussi Kivilinna <jussi.kivilinna@iki.fi>
Diffstat (limited to 'common')
-rw-r--r--common/iobuf.c8
1 files changed, 0 insertions, 8 deletions
diff --git a/common/iobuf.c b/common/iobuf.c
index bde6a5ccc..8ec4c86c0 100644
--- a/common/iobuf.c
+++ b/common/iobuf.c
@@ -2090,14 +2090,6 @@ filter_flush (iobuf_t a)
external_used = 0;
}
- if (src_len == 0)
- {
- if (DBG_IOBUF)
- log_debug ("filter_flush, nothing to flush%s\n",
- external_used ? " (external buffer)" : "");
- return 0;
- }
-
len = src_len;
rc = a->filter (a->filter_ov, IOBUFCTRL_FLUSH, a->chain, src_buf, &len);
if (!rc && len != src_len)