mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-11-27 06:14:17 +01:00
Fix 1-byte buffer overflow in mbedtls_mpi_write_string()
This can only occur for negative numbers. Fixes #2404.
This commit is contained in:
parent
3a70ab9319
commit
eff335d575
@ -572,7 +572,10 @@ int mbedtls_mpi_write_string( const mbedtls_mpi *X, int radix,
|
||||
mbedtls_mpi_init( &T );
|
||||
|
||||
if( X->s == -1 )
|
||||
{
|
||||
*p++ = '-';
|
||||
buflen--;
|
||||
}
|
||||
|
||||
if( radix == 16 )
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user