From 595e98a22419ae352dd925aa9e91b5a427d8c1d6 Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Tue, 16 Sep 2014 21:41:33 -0700 Subject: [PATCH] Check return code of crypto_generichash_init() --- test/default/generichash2.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/test/default/generichash2.c b/test/default/generichash2.c index e1b6a9a9..cd9c889c 100644 --- a/test/default/generichash2.c +++ b/test/default/generichash2.c @@ -15,8 +15,12 @@ int main(void) for (i = 0; i < MAXLEN; ++i) { in[i] = i; - crypto_generichash_init(&st, k, 1 + i % crypto_generichash_KEYBYTES_MAX, - 1 + i % crypto_generichash_BYTES_MAX); + if (crypto_generichash_init(&st, k, + 1 + i % crypto_generichash_KEYBYTES_MAX, + 1 + i % crypto_generichash_BYTES_MAX) != 0) { + printf("crypto_generichash_init()\n"); + return 1; + } crypto_generichash_update(&st, in, i); crypto_generichash_update(&st, in, i); crypto_generichash_update(&st, in, i);