mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-03-28 19:21:08 +00:00
Fix local buffer allocation conditions.
Signed-off-by: Mateusz Starzyk <mateusz.starzyk@mobica.com>
This commit is contained in:
parent
ceb5bc6150
commit
c562788068
@ -351,8 +351,9 @@ int mbedtls_ccm_update( mbedtls_ccm_context *ctx,
|
||||
}
|
||||
|
||||
/* Local output is used for decryption only. */
|
||||
if( ctx->mode == MBEDTLS_CCM_DECRYPT || \
|
||||
ctx->mode == MBEDTLS_CCM_STAR_DECRYPT )
|
||||
if( local_output_len > 0 && \
|
||||
( ctx->mode == MBEDTLS_CCM_DECRYPT || \
|
||||
ctx->mode == MBEDTLS_CCM_STAR_DECRYPT ) )
|
||||
{
|
||||
local_output = mbedtls_calloc( local_output_len, sizeof( *local_output) );
|
||||
if( local_output == NULL )
|
||||
|
Loading…
x
Reference in New Issue
Block a user