simulator: Avoid crash rendering %t in recorder

If we print a really large value, we need to cut off what we print.

Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
This commit is contained in:
Christophe de Dinechin 2024-03-28 19:01:57 +01:00
parent 2fad76ce6c
commit 0df86b131f

View file

@ -59,6 +59,8 @@ size_t recorder_render_object(intptr_t tracing,
{
char tmp[80];
size_t sz = value->render(tmp, sizeof(tmp)-1);
if (sz >= sizeof(tmp))
sz = sizeof(tmp)-1;
tmp[sz] = 0;
result = snprintf(buffer, size, "%p[%lu] %s[%s]",
(void *) value,