summaryrefslogtreecommitdiff
path: root/gps2udp.c
diff options
context:
space:
mode:
authorGary E. Miller <gem@rellim.com>2014-01-03 14:49:50 -0800
committerGary E. Miller <gem@rellim.com>2014-01-03 14:49:50 -0800
commitfd68064578e71f81ef6c03c5b93f6751e2ac656b (patch)
treeb0a928bd266dfd3741b3fa2b00be9e8cf9fba1a9 /gps2udp.c
parent97bdf35b92db1942939bc8b630252859fbf18383 (diff)
downloadgpsd-fd68064578e71f81ef6c03c5b93f6751e2ac656b.tar.gz
gps2udp: tighten the test for a valid client port number.
Diffstat (limited to 'gps2udp.c')
-rw-r--r--gps2udp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gps2udp.c b/gps2udp.c
index bcc5a743..d652d0a5 100644
--- a/gps2udp.c
+++ b/gps2udp.c
@@ -154,7 +154,7 @@ static int open_udp(char **hostport)
errno = 0;
portnum = strtol(portname, &endptr, 10);
- if (0 == portnum || '\0' != *endptr || 0 != errno) {
+ if (1 > portnum || 65535 < portnum || '\0' != *endptr || 0 != errno) {
(void)fprintf(stderr, "gps2udp: syntax is [-u hostname:port] [%s] is not a valid port number\n",portname);
return (-1);
}