1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-25 01:02:24 +00:00

Buffer overruns are embarassing (even if caused by user error), so assert

that this one can't happen until I actually fix it.

[originally from svn r5217]
This commit is contained in:
Ben Harris 2005-01-26 23:49:56 +00:00
parent 2374544eb3
commit 5e35aa383a

View File

@ -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) {