From c58b90a15a281970b4cac37c6edd384d5b4ad3b5 Mon Sep 17 00:00:00 2001 From: Nick Porter Date: Sun, 12 Jan 2025 14:24:14 +0000 Subject: [PATCH] Pacify Coverity (#CID 1638651) Coverity doesn't understand that the limit on the number of parsed digits prevents an overflow. --- src/lib/util/time.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/lib/util/time.c b/src/lib/util/time.c index 01e88384387d..e045065dd754 100644 --- a/src/lib/util/time.c +++ b/src/lib/util/time.c @@ -292,6 +292,10 @@ fr_slen_t fr_time_delta_from_substr(fr_time_delta_t *out, fr_sbuff_t *in, fr_tim * This can't overflow. */ while (f_len < 9) { +#ifdef STATIC_ANALYZER + // Coverity doesn't understand that the previous conditions prevent overflow. + if (f > UINT64_MAX / 10) break; +#endif f *= 10; f_len++; }