From a6480aec44d6106eb932bae1022b75d833ecf636 Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Wed, 9 Aug 2017 18:03:56 +0200 Subject: [PATCH] b64 test: intentionally overestimate sizes overflows will be caught by the guard page, if any --- test/default/sodium_utils.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/default/sodium_utils.c b/test/default/sodium_utils.c index bcf8bc0c..f0dee6bc 100644 --- a/test/default/sodium_utils.c +++ b/test/default/sodium_utils.c @@ -157,10 +157,10 @@ main(void) b64_ = (char *) sodium_malloc(b64_len); randombytes_buf(bin, bin_len); memcpy(buf1, bin, bin_len); - b64 = sodium_bin2base64(b64_, b64_len, bin, bin_len, + b64 = sodium_bin2base64(b64_, b64_len + 10, bin, bin_len, sodium_base64_VARIANT_URLSAFE); assert(b64 != NULL); - assert(sodium_base642bin(bin, bin_len, b64, b64_len, + assert(sodium_base642bin(bin, bin_len + 10, b64, b64_len, NULL, NULL, &b64_end, sodium_base64_VARIANT_URLSAFE) == 0); assert(b64_end == &b64[b64_len - 1]);