From 77860ba866882a6ec65f57378ca64419d14de72e Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Fri, 4 May 2012 01:01:24 +0200 Subject: [PATCH] yarrow: prevent access to NULL pointer --- src/prngs/yarrow.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/prngs/yarrow.c b/src/prngs/yarrow.c index b5cced38..d6566e6e 100644 --- a/src/prngs/yarrow.c +++ b/src/prngs/yarrow.c @@ -343,11 +343,13 @@ int yarrow_test(void) } /* now let's test the hash/cipher that was chosen */ - if ((err = cipher_descriptor[prng.yarrow.cipher].test()) != CRYPT_OK) { - return err; + if (cipher_descriptor[prng.yarrow.cipher].test && + ((err = cipher_descriptor[prng.yarrow.cipher].test()) != CRYPT_OK)) { + return err; } - if ((err = hash_descriptor[prng.yarrow.hash].test()) != CRYPT_OK) { - return err; + if (hash_descriptor[prng.yarrow.hash].test && + ((err = hash_descriptor[prng.yarrow.hash].test()) != CRYPT_OK)) { + return err; } return CRYPT_OK;