diff --git a/src/ocispec/json_common.c b/src/ocispec/json_common.c index 8093b4eb..d6b65979 100644 --- a/src/ocispec/json_common.c +++ b/src/ocispec/json_common.c @@ -142,9 +142,9 @@ int json_double_to_uint64 (double d, uint64_t *converted) { // Safely convert double to uint64_t by checking for potential overflows - if (d >= 9223372036854775807.0) { // Check if value is greater than or equal to 2^32 + if (d >= 4294967296.0) { // Check if value is greater than or equal to 2^32 // TODO: Better solution for converting double to uint64 - char string[20]; + char string[24]; sprintf(string, "%0.f", d); *converted = strtoull(string, NULL, 10); } else {