From defa6ca212ad70dda4d6445dad092e4728ed4185 Mon Sep 17 00:00:00 2001 From: dxl <64101226@qq.com> Date: Sat, 8 Aug 2026 10:39:45 +0800 Subject: [PATCH] Fixed a bug that caused a stringop-overflow warning when compiling load.c. --- client/deps/jansson/load.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/client/deps/jansson/load.c b/client/deps/jansson/load.c index 8ff937f50..38595d11c 100644 --- a/client/deps/jansson/load.c +++ b/client/deps/jansson/load.c @@ -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);