summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Schroeder <mls@suse.de>2014-04-07 13:06:33 +0200
committerMichael Schroeder <mls@suse.de>2014-04-07 13:06:33 +0200
commit3ffe5b4b1be22466b715eab199992513a40e28f4 (patch)
treef357442aeaf6084b8382bacffabacf45fc20cf3a
parent86e8dd2dcdd9c6c0de4a78ea9a039c9b64440757 (diff)
downloadlibsolv-3ffe5b4b1be22466b715eab199992513a40e28f4.tar.gz
libsolv-3ffe5b4b1be22466b715eab199992513a40e28f4.tar.bz2
libsolv-3ffe5b4b1be22466b715eab199992513a40e28f4.zip
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...
-rw-r--r--ext/solv_pgpvrfy.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/ext/solv_pgpvrfy.c b/ext/solv_pgpvrfy.c
index 5dad742..9bc256c 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;