From 934a6d417dba64d88e317fdcf7f794510f727fca Mon Sep 17 00:00:00 2001
From: Matt Johnston <matt@ucc.asn.au>
Date: Fri, 7 Jul 2006 06:43:55 +0000
Subject: [PATCH] BUG: mp_div_2d returns status and it isn't checked. FIX:
 Check and return status. From Erik Hovland

--HG--
extra : convert_revision : 5ffd8cbe12baca17918527c8e8e626600849ad10
---
 libtommath/bn_mp_div.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libtommath/bn_mp_div.c b/libtommath/bn_mp_div.c
index 6b2b8f0d..6e1e0fb7 100644
--- a/libtommath/bn_mp_div.c
+++ b/libtommath/bn_mp_div.c
@@ -269,7 +269,9 @@ int mp_div (mp_int * a, mp_int * b, mp_int * c, mp_int * d)
   }
 
   if (d != NULL) {
-    mp_div_2d (&x, norm, &x, NULL);
+    if ((res = mp_div_2d (&x, norm, &x, NULL)) != MP_OKAY) {
+		goto LBL_Y;
+	}
     mp_exch (&x, d);
   }
 
-- 
GitLab