mirror of
https://git.suyu.dev/suyu/mbedtls.git
synced 2025-12-24 00:06:32 +01:00
Address issues find by manual coverity scan.
This commit is contained in:
parent
c568762a5c
commit
8eb64132da
3 changed files with 20 additions and 3 deletions
|
|
@ -184,7 +184,12 @@ int main( int argc, char *argv[] )
|
|||
mbedtls_fprintf( stderr, "Message Digest '%s' not found\n", argv[5] );
|
||||
goto exit;
|
||||
}
|
||||
mbedtls_md_setup( &md_ctx, md_info, 1 );
|
||||
|
||||
if( mbedtls_md_setup( &md_ctx, md_info, 1 ) != 0 )
|
||||
{
|
||||
mbedtls_fprintf( stderr, "mbedtls_md_setup unsuccessful: This shouldn't happen.\n" );
|
||||
goto exit;
|
||||
}
|
||||
|
||||
/*
|
||||
* Read the secret key and clean the command line.
|
||||
|
|
@ -399,6 +404,18 @@ int main( int argc, char *argv[] )
|
|||
goto exit;
|
||||
}
|
||||
|
||||
/*
|
||||
* Make coverity happy.
|
||||
*/
|
||||
if( mbedtls_cipher_get_block_size( &cipher_ctx ) == 0 )
|
||||
{
|
||||
mbedtls_fprintf( stderr, "mbedtls_cipher_get_block_size returned with 0. This shouldn't happen.\n" );
|
||||
goto exit;
|
||||
}
|
||||
|
||||
/*
|
||||
* Check the file size.
|
||||
*/
|
||||
if( ( ( filesize - mbedtls_md_get_size( md_info ) ) %
|
||||
mbedtls_cipher_get_block_size( &cipher_ctx ) ) != 0 )
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue