]> git.ipfire.org Git - thirdparty/json-c.git/commitdiff
amend: removed marco related logic
authorlone <lonechan314@qq.com>
Mon, 26 Jan 2026 09:54:53 +0000 (17:54 +0800)
committerlone <lonechan314@qq.com>
Mon, 26 Jan 2026 09:54:53 +0000 (17:54 +0800)
Signed-off-by: lone <lonechan314@qq.com>
json_pointer.c

index edaabca3a6686320d49aea97e5410b35ba2f86d5..82df0216673288c28710c2d576d37416c570b323 100644 (file)
@@ -79,16 +79,6 @@ static int is_valid_index(const char *path, size_t *idx)
        // but ULLONG_MAX will be longer than any array length so that's ok.
        *idx = strtoull(path, NULL, 10);
 
-       // Check against a maximum to prevent excessive memory allocations.
-       // An extremely large index, even if it doesn't overflow size_t,
-       // will cause a huge memory allocation request via realloc,
-       // leading to an OOM.
-       if (*idx > JSON_C_POINTER_MAX_ARRAY_IDX)
-       {
-       errno = EINVAL;
-       return 0;
-       }
-
        return 1;
 }