mirror of
https://git.suyu.dev/suyu/mbedtls.git
synced 2025-12-21 21:36:21 +01:00
- Fixed size of clean
This commit is contained in:
parent
4cf2b7f8bf
commit
279432a7c0
2 changed files with 3 additions and 4 deletions
|
|
@ -152,11 +152,10 @@ const md_info_t *md_info_from_type( md_type_t md_type )
|
|||
|
||||
int md_init_ctx( md_context_t *ctx, const md_info_t *md_info )
|
||||
{
|
||||
if( md_info == NULL )
|
||||
if( md_info == NULL || ctx == NULL )
|
||||
return POLARSSL_ERR_MD_BAD_INPUT_DATA;
|
||||
|
||||
if( ctx == NULL || ctx->md_ctx != NULL )
|
||||
return POLARSSL_ERR_MD_BAD_INPUT_DATA;
|
||||
memset( ctx, 0, sizeof( md_context_t ) );
|
||||
|
||||
if( ( ctx->md_ctx = md_info->ctx_alloc_func() ) == NULL )
|
||||
return POLARSSL_ERR_MD_ALLOC_FAILED;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue