1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Bug #11792200 - DIVIDING LARGE NUMBERS CAUSES STACK CORRUPTIONS

This was a buffer overrun in do_div_mod(), overwriting the internal buffer
of auto variable 'tmp' in Item_func_int_div::val_int.
Result on windows: 'this' is set to zero, and crash.
Ran fine on other platforms (no valgrind warnings),
but this is undefined behaviour on any platform of course.
This commit is contained in:
Tor Didriksen
2011-03-03 15:25:41 +01:00
parent 6ebf55aff9
commit 4148b03910
5 changed files with 69 additions and 49 deletions

View File

@ -656,3 +656,11 @@ Warning 1366 Incorrect decimal value: '' for column '' at row -1
SELECT 1 div null;
1 div null
NULL
#
# Bug #11792200 - DIVIDING LARGE NUMBERS CAUSES STACK CORRUPTIONS
#
select (1.175494351E-37 div 1.7976931348623157E+308);
(1.175494351E-37 div 1.7976931348623157E+308)
0
Warnings:
Warning 1292 Truncated incorrect DECIMAL value: ''