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

MDEV-16054 simple json functions flatline cpu on garbage input.

Incorrect char sentence should be handled properly.
This commit is contained in:
Alexey Botchkov
2018-07-31 16:33:05 +04:00
parent fd378fc613
commit f4eac2deeb
3 changed files with 15 additions and 0 deletions

View File

@@ -1645,6 +1645,8 @@ int json_escape(CHARSET_INFO *str_cs,
return -1;
}
}
else /* c_len == 0, an illegal symbol. */
return -1;
}
return (int)(json - json_start);