diff options
author | Bill Meeks <bmeeks8@bellsouth.net> | 2013-01-20 21:31:19 -0500 |
---|---|---|
committer | Bill Meeks <bmeeks8@bellsouth.net> | 2013-01-20 21:31:19 -0500 |
commit | d981652f59caf705fe1f066c57fb9058ed7073cf (patch) | |
tree | 65af928343a9d42fa38bd21fe766bd4b78605be9 | |
parent | ce96b0e676813be429de061d72aef7a447f9bb0e (diff) | |
download | pfsense-packages-d981652f59caf705fe1f066c57fb9058ed7073cf.tar.gz pfsense-packages-d981652f59caf705fe1f066c57fb9058ed7073cf.tar.bz2 pfsense-packages-d981652f59caf705fe1f066c57fb9058ed7073cf.zip |
Fix build_sid_msg_map() and snort_load_rules_map() to check arg type.
-rwxr-xr-x | config/snort/snort.inc | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/config/snort/snort.inc b/config/snort/snort.inc index 93db9424..49b9d4df 100755 --- a/config/snort/snort.inc +++ b/config/snort/snort.inc @@ -737,10 +737,12 @@ function build_sid_msg_map($rules_path, $sid_file) { /* or an array of filenames to read. Set our $rule_files */ /* variable accordingly. If we can't figure it out, return */ /* an empty rules map array. */ - if (is_dir($rules_path)) - $rule_files = glob($rules_path . "*.rules"); - elseif (is_file($rules_path)) - $rule_files = (array)$rules_path; + if (is_string($rules_path)) { + if (is_dir($rules_path)) + $rule_files = glob($rules_path . "*.rules"); + elseif (is_file($rules_path)) + $rule_files = (array)$rules_path; + } elseif (is_array($rules_path)) $rule_files = $rules_path; else @@ -921,10 +923,12 @@ function snort_load_rules_map($rules_path) { /* or an array of filenames to read. Set our $rule_files */ /* variable accordingly. If we can't figure it out, return */ /* an empty rules map array. */ - if (is_dir($rules_path)) - $rule_files = glob($rules_path . "*.rules"); - elseif (is_file($rules_path)) - $rule_files = (array)$rules_path; + if (is_string($rules_path)) { + if (is_dir($rules_path)) + $rule_files = glob($rules_path . "*.rules"); + elseif (is_file($rules_path)) + $rule_files = (array)$rules_path; + } elseif (is_array($rules_path)) $rule_files = $rules_path; else |