From: ben 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-Url: https://git.distorted.org.uk/u/mdw/putty/commitdiff_plain/062af27bcc7ffd6d9d82d4022d625e53dc962351 Buffer overruns are embarassing (even if caused by user error), so assert that this one can't happen until I actually fix it. git-svn-id: svn://svn.tartarus.org/sgt/putty@5217 cda61777-01e9-0310-a592-d414129be87e --- 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) {