BUG/MINOR: stats-json: Define JSON_INT_MAX as a signed integer
authorChristopher Faulet <cfaulet@haproxy.com>
Thu, 6 Feb 2025 16:13:50 +0000 (17:13 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 19 Feb 2025 10:43:06 +0000 (11:43 +0100)
commitd0c16f3353c5e673abb6967a714f1ca22797dbff
treed18712b374c18090b1893ec3df547f858cedfe5b
parente3e565a556ce960ac47f4495687a0bbda38ae160
BUG/MINOR: stats-json: Define JSON_INT_MAX as a signed integer

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.

(cherry picked from commit d48b5add889db1bf2f0fae4721abb46413303d33)
Signed-off-by: Willy Tarreau <w@1wt.eu>
src/stats-json.c