mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-08-01 10:06:53 +03:00
Merge pull request #934 from gilles-peskine-arm/mpi-0-mod-2
Fix null pointer dereference in mpi_mod_int(0, 2)
This commit is contained in:
@ -1785,7 +1785,7 @@ int mbedtls_mpi_mod_int( mbedtls_mpi_uint *r, const mbedtls_mpi *A, mbedtls_mpi_
|
||||
/*
|
||||
* handle trivial cases
|
||||
*/
|
||||
if( b == 1 )
|
||||
if( b == 1 || A->n == 0 )
|
||||
{
|
||||
*r = 0;
|
||||
return( 0 );
|
||||
|
Reference in New Issue
Block a user