0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2025-03-13 21:10:32 +01:00

ircd::json: Enforce max string size on create_string().

This commit is contained in:
Jason Volk 2019-09-08 19:39:42 -07:00
parent 002e7aae1a
commit a6eb3c28ff

View file

@ -3848,6 +3848,14 @@ ircd::json::value::create_string(const size_t &len,
len + 1
};
if(unlikely(max > max_string_size))
throw print_error
{
"Value cannot have string length:%zu which exceeds limit:%zu",
max,
max_string_size,
};
std::unique_ptr<char[]> string
{
new char[max]