From 679dd0b84635097e434a5693eeb7dfa549486f26 Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Wed, 22 Feb 2017 18:10:32 +0100 Subject: [PATCH] (systemhealth) prevent div by zero, for https://github.com/opnsense/core/issues/1421 --- .../OPNsense/Diagnostics/Api/SystemhealthController.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/opnsense/mvc/app/controllers/OPNsense/Diagnostics/Api/SystemhealthController.php b/src/opnsense/mvc/app/controllers/OPNsense/Diagnostics/Api/SystemhealthController.php index 9f06a4a88..5479c8c87 100644 --- a/src/opnsense/mvc/app/controllers/OPNsense/Diagnostics/Api/SystemhealthController.php +++ b/src/opnsense/mvc/app/controllers/OPNsense/Diagnostics/Api/SystemhealthController.php @@ -134,6 +134,7 @@ class SystemhealthController extends ApiControllerBase $from_timestamp = $this->getMaxRange($rra_info)["oldest_timestamp"]; $to_timestamp = $this->getMaxRange($rra_info)["newest_timestamp"]; } + $max_values = ($max_values <=0) ? 1 : $max_values; $archives = array(); // find archive match