mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-06 14:45:14 +00:00
lib/mpi: checks for zero divisor length
Divisor length should not be 0. Signed-off-by: Dmitry Kasatkin <dmitry.kasatkin@intel.com> Reviewed-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> Signed-off-by: James Morris <jmorris@namei.org>
This commit is contained in:
parent
e87c5e35a9
commit
e2fe85c236
1 changed files with 3 additions and 0 deletions
|
@ -149,6 +149,9 @@ int mpi_tdiv_qr(MPI quot, MPI rem, MPI num, MPI den)
|
||||||
mpi_ptr_t marker[5];
|
mpi_ptr_t marker[5];
|
||||||
int markidx = 0;
|
int markidx = 0;
|
||||||
|
|
||||||
|
if (!dsize)
|
||||||
|
return -EINVAL;
|
||||||
|
|
||||||
memset(marker, 0, sizeof(marker));
|
memset(marker, 0, sizeof(marker));
|
||||||
|
|
||||||
/* Ensure space is enough for quotient and remainder.
|
/* Ensure space is enough for quotient and remainder.
|
||||||
|
|
Loading…
Add table
Reference in a new issue