aboutsummaryrefslogtreecommitdiffstats
path: root/config/snort
diff options
context:
space:
mode:
authorBill Meeks <bmeeks8@bellsouth.net>2013-01-20 21:31:19 -0500
committerBill Meeks <bmeeks8@bellsouth.net>2013-01-20 21:31:19 -0500
commitd981652f59caf705fe1f066c57fb9058ed7073cf (patch)
tree65af928343a9d42fa38bd21fe766bd4b78605be9 /config/snort
parentce96b0e676813be429de061d72aef7a447f9bb0e (diff)
downloadpfsense-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.
Diffstat (limited to 'config/snort')
-rwxr-xr-xconfig/snort/snort.inc20
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