From e4e3ad354f0175ec6ed8e39c40ff2a5666856a8b Mon Sep 17 00:00:00 2001 From: bmeeks8 Date: Wed, 22 Jul 2015 18:53:34 -0400 Subject: Verify suricata_widget file handle before trying to use it. --- config/suricata/suricata_alerts.widget.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'config') diff --git a/config/suricata/suricata_alerts.widget.php b/config/suricata/suricata_alerts.widget.php index 81d17c2e..954fef17 100644 --- a/config/suricata/suricata_alerts.widget.php +++ b/config/suricata/suricata_alerts.widget.php @@ -124,7 +124,10 @@ function suricata_widget_get_alerts() { /* 0 1 2 3 4 5 6 7 */ /************** *************************************************************************************************************************/ - $fd = fopen("/tmp/surialerts_{$suricata_uuid}", "r"); + if (!$fd = fopen("/tmp/surialerts_{$suricata_uuid}", "r")) { + log_error(gettext("[Suricata Widget] Failed to open file /tmp/surialerts_{$suricata_uuid}")); + continue; + } $buf = ""; while (($buf = fgets($fd)) !== FALSE) { $fields = array(); -- cgit v1.2.3