1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-01 03:47:19 +03:00

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.
This commit is contained in:
Oleksandr Byelkin
2015-12-10 11:22:53 +01:00
parent d67aacb4fb
commit fa25921b59
2 changed files with 34 additions and 3 deletions

View File

@ -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;