From 877fcc3e4d35f61091b9a2cb245667bdca97a102 Mon Sep 17 00:00:00 2001 From: Andy Green Date: Wed, 7 Apr 2021 09:50:02 +0100 Subject: [PATCH] ss: policy: atoll needed for 32-bit machines On 32-bit Linux compilers, long int == int == 32-bit. So even atol() cannot handle ints above 0x7fffffff and clips any it finds at that. There's only one instance in policy-json.c, use atoll() cast to uint64_t to allow values up to 64-bit INT_MAX even on 32-bit machines. --- lib/secure-streams/policy-json.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/secure-streams/policy-json.c b/lib/secure-streams/policy-json.c index 3e828d89a..dc0b64393 100644 --- a/lib/secure-streams/policy-json.c +++ b/lib/secure-streams/policy-json.c @@ -566,7 +566,7 @@ lws_ss_policy_parser_cb(struct lejp_ctx *ctx, char reason) goto string2; case LSSPPT_METRICS_US_SCHEDULE: - a->curr[LTY_METRICS].m->us_schedule = (uint64_t)atol(ctx->buf); + a->curr[LTY_METRICS].m->us_schedule = (uint64_t)atoll(ctx->buf); break; case LSSPPT_METRICS_US_HALFLIFE: