mirror of
https://github.com/json-c/json-c.git
synced 2026-11-09 07:20:15 +08:00
json_tokener, arraylist: assorted cleanups
json_tokener.c assigned to an int64_t through a (uint64_t) cast. The guarded range makes it harmless, but the cast names the wrong type. array_list_expand_internal() reallocated when max == arr->size even though the array can already hold max entries at that point, since callers only index up to max - 1. Skip the realloc.
This commit is contained in:
1 parent
8381d33d78
commit
596c9d2d03
2 files changed
+5
-2
No files matched your search
+1
-1
@@ -1157,7 +1157,7 @@ struct json_object *json_tokener_parse_ex(struct json_tokener *tok, const char *
|
||||
}
|
||||
if (numuint64 <= INT64_MAX)
|
||||
{
|
||||
num64 = (uint64_t)numuint64;
|
||||
num64 = (int64_t)numuint64;
|
||||
current = json_object_new_int64(num64);
|
||||
if (current == NULL)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user