summaryrefslogtreecommitdiff
path: root/strings/decimal.c
diff options
context:
space:
mode:
authorunknown <holyfoot@deer.(none)>2005-11-02 18:46:13 +0400
committerunknown <holyfoot@deer.(none)>2005-11-02 18:46:13 +0400
commitb6a711bf880928a8f74f89a1971cab19159492d3 (patch)
tree9adab8f4c183ddd9a78468b1e79232698921552d /strings/decimal.c
parent768b1e50871b5d5f76b5a7dcf817b9e347148485 (diff)
downloadmariadb-git-b6a711bf880928a8f74f89a1971cab19159492d3.tar.gz
Additional fix for #13573
strings/decimal.c: here we can run over the buffer - need to check on overflow
Diffstat (limited to 'strings/decimal.c')
-rw-r--r--strings/decimal.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/strings/decimal.c b/strings/decimal.c
index ea6ac2caf38..f536bdb1d6b 100644
--- a/strings/decimal.c
+++ b/strings/decimal.c
@@ -1986,7 +1986,11 @@ int decimal_mul(decimal_t *from1, decimal_t *from2, decimal_t *to)
carry+=hi;
}
for (; carry; buf0--)
+ {
+ if (buf0 < to->buf)
+ return E_DEC_OVERFLOW;
ADD(*buf0, *buf0, 0, carry);
+ }
}
/* Now we have to check for -0.000 case */