]> git.ipfire.org Git - thirdparty/libsolv.git/commitdiff
add "just in case" code if our multiplier gets too big
authorMichael Schroeder <mls@suse.de>
Mon, 7 Apr 2014 11:06:33 +0000 (13:06 +0200)
committerMichael Schroeder <mls@suse.de>
Mon, 7 Apr 2014 11:06:33 +0000 (13:06 +0200)
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...

ext/solv_pgpvrfy.c

index 5dad742217934e02b9e3ff86512e0b5091eff615..9bc256ca9a46b5f80817d29c6d8e4ecfa0bb6a68 100644 (file)
@@ -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;