From: Ben Harris Date: Wed, 26 Jan 2005 23:49:56 +0000 (+0000) Subject: Buffer overruns are embarassing (even if caused by user error), so assert X-Git-Tag: 0.58~188 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=5e35aa383ae0fc5bf8147c0b211c21f50bfbcefb;p=PuTTY.git 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] --- diff --git a/unix/uxnet.c b/unix/uxnet.c index d5d04d6f..71c45151 100644 --- 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) {