Fixed a bug that caused a stringop-overflow warning when compiling load.c.

This commit is contained in:
dxl
2026-08-19 12:04:33 +02:00
committed by Philippe Teuwen
parent 66c5fd8343
commit defa6ca212
+3
View File
@@ -188,6 +188,9 @@ static int stream_get(stream_t *stream, json_error_t *error) {
assert(count >= 2);
assert(count <= 4);
if (count >= sizeof(stream->buffer))
goto out;
// if count == 4 , i will become 5 and overflow.
for (i = 1; i < count; i++)
stream->buffer[i] = stream->get(stream->data);