A JSON integer is defined in the range [-(2**53)+1, (2**53)-1]. Macro are used
to define the minimum and the maximum value, The minimum one is defined using
the maximum one. So JSON_INT_MAX must be defined as a signed integer value to
avoid wrong cast of JSON_INT_MIN.
It was reported by Coverity in #2841: CID
1587769.
This patch could be backported to all stable versions.
/* Limit JSON integer values to the range [-(2**53)+1, (2**53)-1] as per
* the recommendation for interoperable integers in section 6 of RFC 7159.
*/
-#define JSON_INT_MAX ((1ULL << 53) - 1)
+#define JSON_INT_MAX ((1LL << 53) - 1)
#define JSON_INT_MIN (0 - JSON_INT_MAX)
/* Emits a stats field value and its type in JSON.