mirror of
https://github.com/matrix-construct/construct
synced 2024-12-26 15:33:54 +01:00
ircd::json::stack::member: Fix critical assertion; use stack buffer.
This commit is contained in:
parent
777ea844e7
commit
f288d4a816
1 changed files with 4 additions and 3 deletions
|
@ -1596,17 +1596,18 @@ ircd::json::stack::member::member(object &po,
|
|||
if(po.mc)
|
||||
s->append(',');
|
||||
|
||||
thread_local char tmp[2048];
|
||||
static const printer::rule<string_view> rule
|
||||
{
|
||||
printer.name << printer.name_sep
|
||||
};
|
||||
|
||||
char tmp[512];
|
||||
mutable_buffer buf{tmp};
|
||||
if(!printer(buf, rule, name))
|
||||
if(unlikely(!printer(buf, rule, name)))
|
||||
throw error
|
||||
{
|
||||
"member name overflow: max size is under %zu", sizeof(tmp)
|
||||
"member name overflow: max size is under %zu",
|
||||
sizeof(tmp)
|
||||
};
|
||||
|
||||
assert(data(buf) >= tmp);
|
||||
|
|
Loading…
Reference in a new issue