aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbmeeks8 <bmeeks8@bellsouth.net>2015-07-03 23:25:21 -0400
committerbmeeks8 <bmeeks8@bellsouth.net>2015-07-03 23:25:21 -0400
commit945bdb61b7486d61008656cff1c60410e65a387a (patch)
tree45d7b77aca0da457117a3b09d340aaa28967cc19
parent516e627d3fab68844fb4c69257834c847fa92731 (diff)
downloadpfsense-packages-945bdb61b7486d61008656cff1c60410e65a387a.tar.gz
pfsense-packages-945bdb61b7486d61008656cff1c60410e65a387a.tar.bz2
pfsense-packages-945bdb61b7486d61008656cff1c60410e65a387a.zip
Verify snort_widget file handle before trying to use it.
-rw-r--r--config/snort/snort_alerts.widget.php5
1 files changed, 4 insertions, 1 deletions
diff --git a/config/snort/snort_alerts.widget.php b/config/snort/snort_alerts.widget.php
index 96c70562..2b7a10c7 100644
--- a/config/snort/snort_alerts.widget.php
+++ b/config/snort/snort_alerts.widget.php
@@ -125,7 +125,10 @@ function snort_widget_get_alerts() {
/* 0 1 2 3 4 5 6 7 8 9 10 11 12 */
/* File format: timestamp,generator_id,sig_id,sig_rev,msg,proto,src,srcport,dst,dstport,id,classification,priority */
- $fd = fopen("/tmp/alert_snort{$snort_uuid}", "r");
+ if (!$fd = fopen("/tmp/alert_snort{$snort_uuid}", "r")) {
+ log_error(gettext("[Snort Widget] Failed to open file /tmp/alert_snort{$snort_uuid}"));
+ continue;
+ }
while (($fields = fgetcsv($fd, 1000, ',', '"')) !== FALSE) {
if(count($fields) < 13)
continue;