summaryrefslogtreecommitdiffstats
path: root/g10/plaintext.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-18 21:21:05 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-18 21:21:05 +0000
commite7fd617327ed9d30f093a78a016511ab5c984ba4 (patch)
treebb534b4fd912969c90022ad00726253be891ad8a /g10/plaintext.c
parentReleasing progress-linux version 2.2.40-3~progress7.99u1. (diff)
downloadgnupg2-e7fd617327ed9d30f093a78a016511ab5c984ba4.tar.xz
gnupg2-e7fd617327ed9d30f093a78a016511ab5c984ba4.zip
Merging upstream version 2.2.43.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--g10/plaintext.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/g10/plaintext.c b/g10/plaintext.c
index 3bc8696..10d567a 100644
--- a/g10/plaintext.c
+++ b/g10/plaintext.c
@@ -584,11 +584,16 @@ do_hash (gcry_md_hd_t md, gcry_md_hd_t md2, IOBUF fp, int textmode)
}
else
{
- while ((c = iobuf_get (fp)) != -1)
+ byte *buffer = xmalloc (32768);
+ int ret;
+
+ while ((ret = iobuf_read (fp, buffer, 32768)) != -1)
{
if (md)
- gcry_md_putc (md, c);
+ gcry_md_write (md, buffer, ret);
}
+
+ xfree (buffer);
}
}