1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

MDEV-27203: Valgrind / MSAN errors in Histogram_json_hb::parse_bucket

In read_bucket_endpoint(), handle all possible parser states.
This commit is contained in:
Sergei Petrunia
2021-12-13 22:54:33 +03:00
parent d8d57d2c27
commit 08f1c4a2e0
2 changed files with 8 additions and 1 deletions

View File

@@ -480,6 +480,13 @@ bool read_bucket_endpoint(json_engine_t *je, Field *field, String *out,
if (json_read_value(je))
return true;
if (je->value_type != JSON_VALUE_STRING &&
je->value_type != JSON_VALUE_NUMBER)
{
*err= "String or number expected";
return true;
}
const char* je_value= (const char*)je->value;
if (je->value_type == JSON_VALUE_STRING && je->value_escaped)
{