From 36c4a678a646d8446f243e9197ba358f3899cfdf Mon Sep 17 00:00:00 2001 From: Paul Bakker Date: Fri, 9 Nov 2012 15:30:07 +0000 Subject: [PATCH] - Fixed off-by-one loop --- library/ctr_drbg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/ctr_drbg.c b/library/ctr_drbg.c index 1de7f05e9..8cf03712e 100644 --- a/library/ctr_drbg.c +++ b/library/ctr_drbg.c @@ -194,7 +194,7 @@ int ctr_drbg_update_internal( ctr_drbg_context *ctx, /* * Increase counter */ - for( i = CTR_DRBG_BLOCKSIZE; i >= 0; i-- ) + for( i = CTR_DRBG_BLOCKSIZE; i > 0; i-- ) if( ++ctx->counter[i - 1] != 0 ) break;