summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2008-07-03 20:11:30 -0700
committerH. Peter Anvin <hpa@zytor.com>2008-07-03 20:11:30 -0700
commit5aa689f80d66830181044b2977ded7d3c605cd5f (patch)
treedc2f37885aa3a26cfbd5ae54c2f9d23bbd730f68
parent0b826ac316c4d41a25f22a58535326a1d303d59b (diff)
downloadnasm-5aa689f80d66830181044b2977ded7d3c605cd5f.tar.gz
float: fix buffer overrun
Fix a buffer overrun; generally causing hexadecimal constants to be incorrectly rejected.
-rw-r--r--float.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/float.c b/float.c
index 04468ecd..467eafa3 100644
--- a/float.c
+++ b/float.c
@@ -556,10 +556,10 @@ static bool ieee_flconvert_bin(const char *string, int bits,
}
if (!seendigit) {
- memset(mant, 0, sizeof mult); /* Zero */
+ memset(mant, 0, MANT_LIMBS*sizeof(fp_limb)); /* Zero */
*exponent = 0;
} else {
- memcpy(mant, mult, sizeof mult);
+ memcpy(mant, mult, MANT_LIMBS*sizeof(fp_limb));
*exponent = twopwr;
}