From 3ce071300954eda35bf30057386326ac5c4391db Mon Sep 17 00:00:00 2001 From: Jinliang Li Date: Thu, 28 Apr 2022 14:04:34 +0800 Subject: [PATCH] mbedtls: fix whitescan bug in library/cipher.c [Detail] Remove dead code in library/cipher.c CWE561: Code can never be reached because of a logical contradiction [Verified Cases] Build Pass: Test Pass: Signed-off-by: Jinliang Li --- components/mbedtls/library/cipher.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/components/mbedtls/library/cipher.c b/components/mbedtls/library/cipher.c index 273997577b..4367b88ff7 100644 --- a/components/mbedtls/library/cipher.c +++ b/components/mbedtls/library/cipher.c @@ -459,11 +459,6 @@ int mbedtls_cipher_update( mbedtls_cipher_context_t *ctx, const unsigned char *i */ if( 0 != ilen ) { - if( 0 == block_size ) - { - return( MBEDTLS_ERR_CIPHER_INVALID_CONTEXT ); - } - /* Encryption: only cache partial blocks * Decryption w/ padding: always keep at least one whole block * Decryption w/o padding: only cache partial blocks -- GitLab