diff options
author | Gary E. Miller <gem@rellim.com> | 2014-01-03 14:49:50 -0800 |
---|---|---|
committer | Gary E. Miller <gem@rellim.com> | 2014-01-03 14:49:50 -0800 |
commit | fd68064578e71f81ef6c03c5b93f6751e2ac656b (patch) | |
tree | b0a928bd266dfd3741b3fa2b00be9e8cf9fba1a9 /gps2udp.c | |
parent | 97bdf35b92db1942939bc8b630252859fbf18383 (diff) | |
download | gpsd-fd68064578e71f81ef6c03c5b93f6751e2ac656b.tar.gz |
gps2udp: tighten the test for a valid client port number.
Diffstat (limited to 'gps2udp.c')
-rw-r--r-- | gps2udp.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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); } |