summaryrefslogtreecommitdiffstats
path: root/etc/inc/util.inc
diff options
context:
space:
mode:
authorErmal Luçi <eri@pfsense.org>2009-12-23 21:19:34 +0000
committerErmal Luçi <eri@pfsense.org>2009-12-23 21:19:54 +0000
commitd9e258bb1df4c8a0d720c818ad433f8e9f6c3824 (patch)
treeda4cf13294b369e67ffa0c4d270304fa86c9652b /etc/inc/util.inc
parenta3e027f60995f327ec7a795fbc01423147eeaa51 (diff)
downloadpfsense-d9e258bb1df4c8a0d720c818ad433f8e9f6c3824.zip
pfsense-d9e258bb1df4c8a0d720c818ad433f8e9f6c3824.tar.gz
If the port passed as argument is a range(having - in it) this function would still return true as a bad habit of intval. Fix this so it behaves correctly.
Diffstat (limited to 'etc/inc/util.inc')
-rw-r--r--etc/inc/util.inc2
1 files changed, 2 insertions, 0 deletions
diff --git a/etc/inc/util.inc b/etc/inc/util.inc
index 92bb23f..6727f94 100644
--- a/etc/inc/util.inc
+++ b/etc/inc/util.inc
@@ -302,6 +302,8 @@ function is_validaliasname($name) {
function is_port($port) {
if (getservbyname($port, "tcp") || getservbyname($port, "udp"))
return true;
+ if (!ctype_digit($port))
+ return false;
if ((intval($port) < 1) || (intval($port) > 65535))
return false;
else
OpenPOWER on IntegriCloud