]> asedeno.scripts.mit.edu Git - PuTTY.git/commitdiff
Buffer overruns are embarassing (even if caused by user error), so assert
authorBen Harris <bjh21@bjh21.me.uk>
Wed, 26 Jan 2005 23:49:56 +0000 (23:49 +0000)
committerBen Harris <bjh21@bjh21.me.uk>
Wed, 26 Jan 2005 23:49:56 +0000 (23:49 +0000)
that this one can't happen until I actually fix it.

[originally from svn r5217]

unix/uxnet.c

index d5d04d6f7e7650a9d785d75f6b26f01dacee8edc..71c451514ee80c15ddc3a29f5c9b4e8c9772be16 100644 (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) {