From 00a062c6759ea5934484d7f78df42830c7f8ae2c Mon Sep 17 00:00:00 2001 From: David Bell Date: Thu, 9 Mar 2017 23:16:35 +0000 Subject: [PATCH] Add error checking for DS name length (#6093) * Add error checking for DS name length * Update RrdDefinition.php * Move greater than 19 length test to unit test * Remove unused variables * Remove duplicate unit test, and update test for empty name * Typo * Remove extra assignment * ... * Remove unused items * Update RrdDefinitionTest.php * Update RrdDefinition.php * Delete InvalidRrdNameException.php --- LibreNMS/RRD/RrdDefinition.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/LibreNMS/RRD/RrdDefinition.php b/LibreNMS/RRD/RrdDefinition.php index 1d7bbf2432..8411f864bf 100644 --- a/LibreNMS/RRD/RrdDefinition.php +++ b/LibreNMS/RRD/RrdDefinition.php @@ -55,6 +55,10 @@ class RrdDefinition { global $config; + if (empty($name)) { + d_echo("DS must be set to a non-empty string."); + } + $ds = array(); $ds[] = $this->escapeName($name); $ds[] = $this->checkType($type);