summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libtommath/bn_mp_root_n.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libtommath/bn_mp_root_n.c b/libtommath/bn_mp_root_n.c
index 51ad759..c028ef1 100644
--- a/libtommath/bn_mp_root_n.c
+++ b/libtommath/bn_mp_root_n.c
@@ -18,7 +18,7 @@ mp_err mp_root_n(const mp_int *a, int b, mp_int *c)
int ilog2;
mp_err err;
- if (b < 0 || (unsigned)b > (unsigned)MP_DIGIT_MAX) {
+ if ((unsigned)b > (unsigned)MP_MIN(MP_DIGIT_MAX, INT_MAX)) {
return MP_VAL;
}