mirror of
https://github.com/json-c/json-c.git
synced 2026-11-05 21:20:16 +08:00
Merge pull request #971 from prownd/json_tokener-arraylist-assorted-cleanups-s01
json_tokener, arraylist: assorted cleanups
This commit is contained in:
2 files changed
+5
-2
No files matched your search
+4
-1
@@ -83,7 +83,10 @@ static int array_list_expand_internal(struct array_list *arr, size_t max)
|
||||
void *t;
|
||||
size_t new_size;
|
||||
|
||||
if (max < arr->size)
|
||||
/* The array can already hold max entries when max == arr->size, since
|
||||
* the caller only ever indexes up to max - 1.
|
||||
*/
|
||||
if (max <= arr->size)
|
||||
return 0;
|
||||
/* Avoid undefined behaviour on size_t overflow */
|
||||
if (arr->size >= SIZE_T_MAX / 2)
|
||||
|
||||
+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