lib/mpi: checks for zero divisor length

Divisor length should not be 0.

Signed-off-by: Dmitry Kasatkin <[email protected]>
Reviewed-by: Tetsuo Handa <[email protected]>
Signed-off-by: James Morris <[email protected]>
This commit is contained in:
Dmitry Kasatkin 2012-01-26 19:13:22 +02:00 • committed by James Morris
commit e2fe85c236

View file

@ -149,6 +149,9 @@ int mpi_tdiv_qr(MPI quot, MPI rem, MPI num, MPI den)
mpi_ptr_t marker[5];
int markidx = 0;
if (!dsize)
return -EINVAL;
memset(marker, 0, sizeof(marker));
/* Ensure space is enough for quotient and remainder.