projects
/
u
/
mdw
/
putty
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Buffer overruns are embarassing (even if caused by user error), so assert
[u/mdw/putty]
/
unix
/
uxnet.c
diff --git
a/unix/uxnet.c
b/unix/uxnet.c
index
d5d04d6
..
71c4515
100644
(file)
--- a/
unix/uxnet.c
+++ b/
unix/uxnet.c
@@
-728,6
+728,7
@@
Socket sk_newlistener(char *srcaddr, int port, Plug plug, int local_host_only, i
hints.ai_addr = NULL;
hints.ai_canonname = NULL;
hints.ai_next = NULL;
+ assert(port >= 0 && port <= 99999);
sprintf(portstr, "%d", port);
retcode = getaddrinfo(srcaddr, portstr, &hints, &ai);
if (retcode == 0) {