projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a6d68ec
)
lib/mpi: added missing NULL check
author
Dmitry Kasatkin
<
[email protected]
>
Thu, 26 Jan 2012 17:13:18 +0000
(19:13 +0200)
committer
James Morris
<
[email protected]
>
Wed, 1 Feb 2012 13:23:39 +0000
(
00:23
+1100)
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]
>
lib/mpi/mpi-div.c
patch
|
blob
|
history
diff --git
a/lib/mpi/mpi-div.c
b/lib/mpi/mpi-div.c
index 8a45717bd001e0ea36855de0ba2312e07983d92b..f68cbbb4d4a4ec74246be1559e2beaa0c1ce5284 100644
(file)
--- a/
lib/mpi/mpi-div.c
+++ b/
lib/mpi/mpi-div.c
@@
-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. */