Fix CodeQL alert (#15384)
Fix CodeQL alert -- Multiplication result converted to larger type
Stelios Fragkakis committed
Jul 13, 2023 at 18:52 UTC
3d895d97c8c6dd0c49159945430a411df455ac23
1 file changed
+2
-2
database/rrdhost.c
+2
-2
@@ -353,8 +353,8 @@ int is_legacy = 1;
353
case RRD_MEMORY_MODE_MAP:
354
case RRD_MEMORY_MODE_SAVE:
355
case RRD_MEMORY_MODE_RAM:
356
- if(host->rrdpush_seconds_to_replicate > host->rrd_history_entries * host->rrd_update_every)
357
- host->rrdpush_seconds_to_replicate = host->rrd_history_entries * host->rrd_update_every;
356
+ if(host->rrdpush_seconds_to_replicate > (time_t) host->rrd_history_entries * (time_t) host->rrd_update_every)
357
+ host->rrdpush_seconds_to_replicate = (time_t) host->rrd_history_entries * (time_t) host->rrd_update_every;
358
break;
359
360
case RRD_MEMORY_MODE_DBENGINE: