summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Schaumburg <pschaumburg@tecracer.de>2020-03-30 16:29:52 +0200
committerPatrick Schaumburg <pschaumburg@tecracer.de>2020-03-30 16:29:52 +0200
commit177275193e68f7dfc2a503485482e639d95809c9 (patch)
tree6926c3dee30497cf3c70eea6c0fb2c1d2d18c4b6
parent9a0a642fdcb32306a7e4cd0d7895b1ff116c665e (diff)
downloadchef-177275193e68f7dfc2a503485482e639d95809c9.tar.gz
add missing validation
Signed-off-by: Patrick Schaumburg <pschaumburg@tecracer.de>
-rw-r--r--lib/chef/resource/windows_firewall_rule.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/chef/resource/windows_firewall_rule.rb b/lib/chef/resource/windows_firewall_rule.rb
index fcc373c7cb..02c9126690 100644
--- a/lib/chef/resource/windows_firewall_rule.rb
+++ b/lib/chef/resource/windows_firewall_rule.rb
@@ -252,6 +252,7 @@ class Chef
elsif icmp_type.is_a?(String)
return false if !protocol.start_with?("ICMP") && icmp_type !~ /^\D+$/
return false if icmp_type.count("a-zA-Z") > 0 && icmp_type.count(":") > 1
+ return false if !(0..255).include?(icmp_type.to_i)
if protocol.start_with?("ICMP") && icmp_type.include?(":")
return icmp_type.split(":").all? { |type| (0..255).include?(type.to_i) }