From 9a1bb60285df1183710bddf7bb22c878ee53a3cf Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Fri, 25 Jan 2019 07:32:34 -0800 Subject: mul: add forgotten MPI error check. * arith.c (mul): In code that is only compiled when HAVE_DOUBLE_INTPTR_T is missing/zero, we need to test the return value of MPI's mp_mul. --- arith.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/arith.c b/arith.c index 7289836e..f36c76ec 100644 --- a/arith.c +++ b/arith.c @@ -845,11 +845,14 @@ tail: } else { val n = make_bignum(); mp_int tmpb; + mp_err mpe; mp_init(&tmpb); mp_set_intptr(&tmpb, b); mp_set_intptr(mp(n), a); - mp_mul(mp(n), &tmpb, mp(n)); + mpe = mp_mul(mp(n), &tmpb, mp(n)); mp_clear(&tmpb); + if (mpe != MP_OKAY) + do_mp_error(self, mpe); return n; } #endif -- cgit v1.2.3