From 0f7a066f3ad17fdff76232df976c0b2b4f3288b1 Mon Sep 17 00:00:00 2001 From: Tony Murray Date: Sun, 10 Sep 2023 18:18:28 -0500 Subject: [PATCH] Fix issue with rrdcached with bad input (#15301) fixes #15299 --- includes/polling/applications/rrdcached.inc.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/includes/polling/applications/rrdcached.inc.php b/includes/polling/applications/rrdcached.inc.php index dfe553f49f..f5d07697ec 100644 --- a/includes/polling/applications/rrdcached.inc.php +++ b/includes/polling/applications/rrdcached.inc.php @@ -26,6 +26,7 @@ */ use LibreNMS\RRD\RrdDefinition; +use LibreNMS\Util\Number; $data = ''; $name = 'rrdcached'; @@ -62,7 +63,7 @@ if ($agent_data['app'][$name]) { $data .= fgets($sock, 128); if ($max == -1) { $tmp_max = explode(' ', $data); - $max = $tmp_max[0] + 1; + $max = Number::cast($tmp_max[0]) + 1; } $count++; }