json BUGFIX labs() in lyjson_exp_number
Trying to take the absolute value of the most negative integer
(type of long) is not defined.
diff --git a/src/json.c b/src/json.c
index 7b23f30..d4fe20b 100644
--- a/src/json.c
+++ b/src/json.c
@@ -514,7 +514,7 @@
/* Convert exponent. */
errno = 0;
e_val = strtol(exponent + 1, NULL, LY_BASE_DEC);
- if (errno || (labs(e_val) > UINT16_MAX)) {
+ if (errno || (e_val > UINT16_MAX) || (e_val < -UINT16_MAX)) {
LOGVAL(ctx, LYVE_SEMANTICS,
"Exponent out-of-bounds in a JSON Number value (%.*s).",
total_len, in);