core: stream: fix buffer overflow in stream indentation stack

This commit is contained in:
2025-09-22 10:31:53 +01:00
parent 4ab524a66b
commit bc5986150c

View File

@@ -256,7 +256,7 @@ enum b_status b_stream_push_indent(b_stream *stream, int indent)
stream->s_istack_ptr = 0;
}
if (stream->s_istack_ptr + 1 > stream->s_istack_size) {
if (stream->s_istack_ptr + 1 >= stream->s_istack_size) {
int *buf = realloc(
stream->s_istack,
(stream->s_istack_size + 4) * sizeof(int));