Fix issue with rrdcached with bad input (#15301)

fixes #15299
This commit is contained in:
Tony Murray
2023-09-11 01:18:28 +02:00
committed by GitHub
co-authored by GitHub
parent 74ed7aa703
commit 0f7a066f3a
@@ -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++;
}