commit | 6c21276342203f06073fd70493433b5d90f14a6a | [log] [tgz] |
---|---|---|
author | Paul Bakker <p.j.bakker@polarssl.org> | Mon Dec 16 15:24:50 2013 +0100 |
committer | Paul Bakker <p.j.bakker@polarssl.org> | Tue Dec 17 13:09:12 2013 +0100 |
tree | 12a439ce7b25c448ab31cfd9c6bc5daaf01728e3 | |
parent | 6f0636a09f65316c811acea83fe360703c243793 [diff] |
Place olen initalization after reference check in cipher_update()
diff --git a/library/cipher.c b/library/cipher.c index f0a770a..bfb229e 100644 --- a/library/cipher.c +++ b/library/cipher.c
@@ -241,13 +241,13 @@ { 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 ) )