Merge branch 'backtrace_oob' into 'main'

gbacktrace: Fix OOB write in stack_trace

See merge request GNOME/glib!4701
This commit is contained in:
Philip Withnall
2025-07-21 11:36:47 +00:00

View File

@@ -497,7 +497,7 @@ stack_trace (const char * const *args)
}
break;
case 1:
if (idx < BUFSIZE)
if (idx < BUFSIZE - 1)
buffer[idx++] = c;
if ((c == '\n') || (c == '\r'))
{