Commit a1d96041 authored by unknown's avatar unknown

Fix for the bug #5371 (Prepared query converting float to string blows the

stack)
We just don't expect BIG buffer to be sent for just a double


libmysql/libmysql.c:
  We shouldn't fall if the buffer_length is bigger than 330
parent 9d8d16cc
...@@ -3490,7 +3490,7 @@ static void fetch_float_with_conversion(MYSQL_BIND *param, MYSQL_FIELD *field, ...@@ -3490,7 +3490,7 @@ static void fetch_float_with_conversion(MYSQL_BIND *param, MYSQL_FIELD *field,
if (field->decimals >= 31) if (field->decimals >= 31)
#undef NOT_FIXED_DEC #undef NOT_FIXED_DEC
{ {
sprintf(buff, "%-*.*g", (int) param->buffer_length, width, value); sprintf(buff, "%-*.*g", (int) min(330, param->buffer_length), width, value);
end= strcend(buff, ' '); end= strcend(buff, ' ');
*end= 0; *end= 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment