Skip to content

Commit

Permalink
Pacify Coverity (#CID 1638651)
Browse files Browse the repository at this point in the history
Coverity doesn't understand that the limit on the number of parsed
digits prevents an overflow.
  • Loading branch information
ndptech committed Jan 12, 2025
1 parent 4fc0486 commit c58b90a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/lib/util/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -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++;
}
Expand Down

0 comments on commit c58b90a

Please sign in to comment.