From fa25921b59aacdc6be050653f6cce17df12c6937 Mon Sep 17 00:00:00 2001 From: Oleksandr Byelkin Date: Thu, 10 Dec 2015 11:22:53 +0100 Subject: MDEV-8407 Numeric errors, server crash with COLUMN_JSON() on DECIMAL with precision > 40 In fact it was error in decimal library (incorrect processing of buffer overflow) invisible from other server parts because of buffer allocation and precision tests. --- strings/decimal.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'strings/decimal.c') diff --git a/strings/decimal.c b/strings/decimal.c index 07ccc537e47..8dbe1bd57f4 100644 --- a/strings/decimal.c +++ b/strings/decimal.c @@ -383,7 +383,8 @@ int decimal2string(const decimal_t *from, char *to, int *to_len, } else frac-=j; - len= from->sign + intg_len + test(frac) + frac_len; + frac_len= frac; + len= from->sign + intg_len + test(frac) + frac; } *to_len=len; s[len]=0; -- cgit v1.2.1