From 6c21276342203f06073fd70493433b5d90f14a6a Mon Sep 17 00:00:00 2001
From: Paul Bakker
Date: Mon, 16 Dec 2013 15:24:50 +0100
Subject: [PATCH] Place olen initalization after reference check in
cipher_update()
---
library/cipher.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/library/cipher.c b/library/cipher.c
index f0a770aba..bfb229e2f 100644
--- a/library/cipher.c
+++ b/library/cipher.c
@@ -241,13 +241,13 @@ int cipher_update( cipher_context_t *ctx, const unsigned char *input, size_t ile
{
int ret;
- *olen = 0;
-
if( NULL == ctx || NULL == ctx->cipher_info || NULL == olen )
{
return POLARSSL_ERR_CIPHER_BAD_INPUT_DATA;
}
+ *olen = 0;
+
if( ctx->cipher_info->mode == POLARSSL_MODE_ECB )
{
if( ilen != cipher_get_block_size( ctx ) )