mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-12-23 20:25:38 +00:00
Fix bug in get_pkcs_padding(): cannot be 0-length
This commit is contained in:
parent
a640849b55
commit
b7d24bc7ca
|
@ -546,7 +546,7 @@ static int get_pkcs_padding( unsigned char *input, size_t input_len,
|
|||
|
||||
padding_len = input[input_len - 1];
|
||||
|
||||
if( padding_len > input_len )
|
||||
if( padding_len > input_len || padding_len == 0 )
|
||||
return POLARSSL_ERR_CIPHER_INVALID_PADDING;
|
||||
|
||||
for( i = input_len - padding_len; i < input_len; i++ )
|
||||
|
|
Loading…
Reference in a new issue