From: Michael Schroeder Date: Mon, 7 Apr 2014 11:06:33 +0000 (+0200) Subject: add "just in case" code if our multiplier gets too big X-Git-Tag: 0.6.4~34 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3ffe5b4b1be22466b715eab199992513a40e28f4;p=thirdparty%2Flibsolv.git add "just in case" code if our multiplier gets too big I don't think that this can happen the way we use the modulo code, but I feel somewhat safer with the check in place... --- diff --git a/ext/solv_pgpvrfy.c b/ext/solv_pgpvrfy.c index 5dad7422..9bc256ca 100644 --- a/ext/solv_pgpvrfy.c +++ b/ext/solv_pgpvrfy.c @@ -70,6 +70,8 @@ mpdomod(int len, mp_t *target, mp2_t x, mp_t *mod) /* reduce */ mp2_t z = x / ((mp2_t)mod[i] + 1); mp2_t n = 0; + if ((z >> MP_T_BITS) != 0) + z = (mp2_t)1 << MP_T_BITS; /* just in case... */ for (j = 0; j < i; j++) { mp_t n2;