From fd4478288e72d694a311ed9c639badd91f08dd5c Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Fri, 25 Aug 2017 15:24:46 +0200 Subject: [PATCH] Test sodium_pad() with a NULL pointer --- test/default/sodium_utils.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/default/sodium_utils.c b/test/default/sodium_utils.c index 06e9615a..d748f1ef 100644 --- a/test/default/sodium_utils.c +++ b/test/default/sodium_utils.c @@ -294,6 +294,8 @@ main(void) assert(sodium_pad(&bin_padded_len, bin_padded, bin_len, blocksize, bin_padded_maxlen - 1U) == -1); + assert(sodium_pad(NULL, bin_padded, bin_len, + blocksize, bin_padded_maxlen + 1U) == 0); assert(sodium_pad(&bin_padded_len, bin_padded, bin_len, blocksize, bin_padded_maxlen + 1U) == 0); assert(sodium_pad(&bin_padded_len, bin_padded, bin_len,