diff options
author | zimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4> | 2000-09-28 09:37:20 +0000 |
---|---|---|
committer | zimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4> | 2000-09-28 09:37:20 +0000 |
commit | 8920da8ae439757d7974a94b7ff9ff9efdea34c2 (patch) | |
tree | c216ff68e593f7a7834ef71db7a6311c549e54f1 /sub.c | |
parent | c5d05bb58c9c74bafa167495e14a00960229257e (diff) | |
download | mpfr-8920da8ae439757d7974a94b7ff9ff9efdea34c2.tar.gz |
fixed two Array Bound Writes
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@759 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'sub.c')
-rw-r--r-- | sub.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -253,11 +253,11 @@ mpfr_sub1(a, b, c, rnd_mode, diff_exp) if (cn >= k+1) ap[0] += cp[cn-k-1]>>(BITS_PER_MP_LIMB+dif); } - else MPN_COPY(ap, cp+(cn-k), k); + else MPN_COPY(ap, cp+(cn-k), (k<=an) ? k : an); overlap=1; } else { /* c is not truncated, but we have to fill low limbs with 0 */ - MPN_ZERO(ap, k-cn); + MPN_ZERO(ap, (k-cn<an) ? k-cn : an); overlap = cancel-diff_exp; #ifdef DEBUG printf("0:a="); mpfr_print_raw(a); putchar('\n'); |