Skip to content

Commit

Permalink
lib/mpi: added missing NULL check
Browse files Browse the repository at this point in the history
Added missing NULL check after mpi_alloc_limb_space().

Signed-off-by: Dmitry Kasatkin <[email protected]>
Reviewed-by: Tetsuo Handa <[email protected]>
Signed-off-by: James Morris <[email protected]>
  • Loading branch information
Dmitry Kasatkin authored and James Morris committed Feb 1, 2012
1 parent a6d68ec commit 43b2c0a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/mpi/mpi-div.c
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,8 @@ int mpi_tdiv_qr(MPI quot, MPI rem, MPI num, MPI den)
* numerator would be gradually overwritten by the quotient limbs. */
if (qp == np) { /* Copy NP object to temporary space. */
np = marker[markidx++] = mpi_alloc_limb_space(nsize);
if (!np)
goto nomem;
MPN_COPY(np, qp, nsize);
}
} else /* Put quotient at top of remainder. */
Expand Down

0 comments on commit 43b2c0a

Please sign in to comment.