summaryrefslogtreecommitdiff
path: root/sub.c
diff options
context:
space:
mode:
authorhanrot <hanrot@280ebfd0-de03-0410-8827-d642c229c3f4>1999-06-24 12:22:57 +0000
committerhanrot <hanrot@280ebfd0-de03-0410-8827-d642c229c3f4>1999-06-24 12:22:57 +0000
commit0f385cb8314dca738841506c8b0cede45309d6d7 (patch)
tree9b074c0ed53f8b4baed0413692c19d12e22e8f37 /sub.c
parent20a671c7976066356dbfc4ba356c58aac85df938 (diff)
downloadmpfr-0f385cb8314dca738841506c8b0cede45309d6d7.tar.gz
Patched an Array Bound Read.
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@165 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'sub.c')
-rw-r--r--sub.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sub.c b/sub.c
index 00deb3391..760507e11 100644
--- a/sub.c
+++ b/sub.c
@@ -217,7 +217,8 @@ ck(ap, k, 11);
cc = mpn_lshift(ap, cp+(cn-k), k, -dif);
if (k<an) { ck(ap+k, 1, 12); ap[k]=cc; }
/* put the non-significant bits in low limb for further rounding */
- ap[0] += cp[cn-k-1]>>(mp_bits_per_limb+dif);
+ if (cn >= k+1)
+ ap[0] += cp[cn-k-1]>>(mp_bits_per_limb+dif);
}
else { ck(ap, k, 13); MPN_COPY(ap, cp+(cn-k), k); }
overlap=1;