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:
parent
002e7aae1a
commit
a6eb3c28ff
1 changed files with 8 additions and 0 deletions
|
@ -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]
|
||||
|
|
Loading…
Add table
Reference in a new issue