• unknown's avatar
    Fixed bug #31019: the MOD() function and the % operator crash the server · 91dc1bb9
    unknown authored
    when a divisor is less than 1 and its fractional part is very long.
    For example:
    1 % .123456789123456789123456789123456789123456789123456789123456789123456789123456789;
    
    Stack buffer overflow has been fixed in the do_div_mod function.
    
    
    strings/decimal.c:
      Fixed bug #31019.
      Stack buffer overflow has been fixed in the do_div_mod function:
      a value of the upper bound of the buffer was increased where
      a decrement is required.
    mysql-test/t/type_decimal.test:
      Added test case for bug #31019.
    mysql-test/r/type_decimal.result:
      Added test case for bug #31019.
    91dc1bb9
decimal.c 85.2 KB