From 02afa68458c61a4081933112acfe95da0698d6ee Mon Sep 17 00:00:00 2001 From: jim-p Date: Sat, 15 Aug 2009 00:44:25 -0400 Subject: [PATCH] Fix potential bug in UPnP config. If the shaper has never been used, the value being checked may not exist or not be an array. --- usr/local/pkg/miniupnpd.inc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/usr/local/pkg/miniupnpd.inc b/usr/local/pkg/miniupnpd.inc index 328d9eca88..8d45badd20 100644 --- a/usr/local/pkg/miniupnpd.inc +++ b/usr/local/pkg/miniupnpd.inc @@ -34,7 +34,11 @@ function upnp_validate_queue($qname) { read_altq_config(); $qlist = get_altq_name_list(); - return in_array($qname, $qlist); + if (is_array($qlist)) { + return in_array($qname, $qlist); + } else { + return false; + } } function upnp_validate_ip($ip, $check_cdir) {