From: lone Date: Tue, 27 Jan 2026 06:43:56 +0000 (+0800) Subject: fix: adapt to the early C std X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bda8299eb1f28ef515e273cd7165412e51c73956;p=thirdparty%2Fjson-c.git fix: adapt to the early C std Signed-off-by: lone --- diff --git a/json_pointer.c b/json_pointer.c index 82df021..9168329 100644 --- a/json_pointer.c +++ b/json_pointer.c @@ -430,13 +430,14 @@ int json_pointer_set_with_limit_index(struct json_object **obj, const char *path int json_object_array_put_idx_with_limit_cb(struct json_object *jso, size_t idx, struct json_object *jso_new, void *priv) { + size_t max_idx; // use priv as a size_t pointer to pass in the maximum allowed index if (!priv) { errno = EINVAL; return -1; } - size_t max_idx = *(size_t*)priv; + max_idx = *(size_t*)priv; // Check against a maximum to prevent excessive memory allocations. // An extremely large index, even if it doesn't overflow size_t,