[PATCH 5/5] [tests] increase size of some buffers that were being overflowed
Shawn Landden
shawn at git.icu
Tue Jul 9 14:29:02 CEST 2019
with this everything is valgrind-clean
2019-07-09 Shawn Landden <shawn at git.icu>
* cipher/mac-poly1305.c: Increase size of overflowed buffers.
* tests/basic.c: Increase size of overflowed buffers.
---
cipher/mac-poly1305.c | 2 +-
tests/basic.c | 6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/cipher/mac-poly1305.c b/cipher/mac-poly1305.c
index b80f87db..612a48f4 100644
--- a/cipher/mac-poly1305.c
+++ b/cipher/mac-poly1305.c
@@ -53,7 +53,7 @@ poly1305mac_open (gcry_mac_hd_t h)
if (secure)
mac_ctx = xtrycalloc_secure (1, sizeof(*mac_ctx));
else
- mac_ctx = xtrycalloc (1, sizeof(*mac_ctx));
+ mac_ctx = xtrycalloc (1, sizeof(*mac_ctx)*2);
if (!mac_ctx)
return gpg_err_code_from_syserror ();
diff --git a/tests/basic.c b/tests/basic.c
index b798eaaf..7454bce5 100644
--- a/tests/basic.c
+++ b/tests/basic.c
@@ -8462,9 +8462,9 @@ check_one_cipher_core (int algo, int mode, int flags,
unsigned int pos;
unsigned int taglen;
- in_buffer = malloc (nplain + 1);
- out_buffer = malloc (nplain + 1);
- enc_result = malloc (nplain);
+ in_buffer = malloc (nplain + 17);
+ out_buffer = malloc (nplain + 17);
+ enc_result = malloc (nplain + 17);
if (!in_buffer || !out_buffer || !enc_result)
{
fail ("pass %d, algo %d, mode %d, malloc failed\n",
--
2.20.1
More information about the Gcrypt-devel
mailing list