]> git.ipfire.org Git - thirdparty/libsolv.git/commitdiff
solv_pgpvrfy: fix buf in modulo reduction
authorMichael Schroeder <mls@suse.de>
Sun, 17 May 2020 16:05:43 +0000 (18:05 +0200)
committerMichael Schroeder <mls@suse.de>
Sun, 17 May 2020 16:05:43 +0000 (18:05 +0200)
The carry propagation did not work when subtracting
the modulo at the end of the computation.

I am amazed that this did not show up earlier.

ext/solv_pgpvrfy.c

index 9bc256ca9a46b5f80817d29c6d8e4ecfa0bb6a68..a5b8f8301e53fdab3feb2eb3f00e67ff12457a44 100644 (file)
@@ -101,7 +101,7 @@ mpdomod(int len, mp_t *target, mp2_t x, mp_t *mod)
       n = 0;
       for (j = 0; j <= i; j++)
        {
-         mp2_t n2 = mod[j] + n;
+         mp2_t n2 = (mp2_t)mod[j] + n;
          n = n2 > target[j] ? 1 : 0;
          target[j] -= (mp_t)n2;
        }