Place olen initalization after reference check in cipher_update()

This commit is contained in:
Paul Bakker 2013-12-16 15:24:50 +01:00
parent 6f0636a09f
commit 6c21276342

View File

@ -241,13 +241,13 @@ int cipher_update( cipher_context_t *ctx, const unsigned char *input, size_t ile
{ {
int ret; int ret;
*olen = 0;
if( NULL == ctx || NULL == ctx->cipher_info || NULL == olen ) if( NULL == ctx || NULL == ctx->cipher_info || NULL == olen )
{ {
return POLARSSL_ERR_CIPHER_BAD_INPUT_DATA; return POLARSSL_ERR_CIPHER_BAD_INPUT_DATA;
} }
*olen = 0;
if( ctx->cipher_info->mode == POLARSSL_MODE_ECB ) if( ctx->cipher_info->mode == POLARSSL_MODE_ECB )
{ {
if( ilen != cipher_get_block_size( ctx ) ) if( ilen != cipher_get_block_size( ctx ) )