mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-03-22 06:38:37 -05: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:
parent
2374544eb3
commit
5e35aa383a
@ -728,6 +728,7 @@ Socket sk_newlistener(char *srcaddr, int port, Plug plug, int local_host_only, i
|
|||||||
hints.ai_addr = NULL;
|
hints.ai_addr = NULL;
|
||||||
hints.ai_canonname = NULL;
|
hints.ai_canonname = NULL;
|
||||||
hints.ai_next = NULL;
|
hints.ai_next = NULL;
|
||||||
|
assert(port >= 0 && port <= 99999);
|
||||||
sprintf(portstr, "%d", port);
|
sprintf(portstr, "%d", port);
|
||||||
retcode = getaddrinfo(srcaddr, portstr, &hints, &ai);
|
retcode = getaddrinfo(srcaddr, portstr, &hints, &ai);
|
||||||
if (retcode == 0) {
|
if (retcode == 0) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user