mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
MDEV-26724 Endless loop in json_escape_to_string upon ... empty string
Part#3: - make json_escape() return different errors on conversion error and on out-of-space condition. - Make histogram code handle conversion errors.
This commit is contained in:
@@ -81,7 +81,10 @@ static bool json_escape_to_string(const String *str, String* out)
|
||||
return false; // Ok
|
||||
}
|
||||
|
||||
// We get here if the escaped string didn't fit into memory.
|
||||
if (res != JSON_ERROR_OUT_OF_SPACE)
|
||||
return true; // Some conversion error
|
||||
|
||||
// Out of space error. Try with a bigger buffer
|
||||
if (out->alloc(out->alloced_length()*2))
|
||||
return true;
|
||||
}
|
||||
|
Reference in New Issue
Block a user