mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-02-05 00:40:09 +00: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
f352f75f6b
commit
c983c81a23
@ -602,7 +602,10 @@ int mbedtls_mpi_write_string( const mbedtls_mpi *X, int radix,
|
|||||||
mbedtls_mpi_init( &T );
|
mbedtls_mpi_init( &T );
|
||||||
|
|
||||||
if( X->s == -1 )
|
if( X->s == -1 )
|
||||||
|
{
|
||||||
*p++ = '-';
|
*p++ = '-';
|
||||||
|
buflen--;
|
||||||
|
}
|
||||||
|
|
||||||
if( radix == 16 )
|
if( radix == 16 )
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user