From owner-cvs-all Fri Jul 20 5: 2:37 2001 Delivered-To: cvs-all@freebsd.org Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 4CE8837B401; Fri, 20 Jul 2001 05:02:30 -0700 (PDT) (envelope-from ru@FreeBSD.org) Received: (from ru@localhost) by freefall.freebsd.org (8.11.4/8.11.4) id f6KC2U389652; Fri, 20 Jul 2001 05:02:30 -0700 (PDT) (envelope-from ru) Message-Id: <200107201202.f6KC2U389652@freefall.freebsd.org> From: Ruslan Ermilov Date: Fri, 20 Jul 2001 05:02:30 -0700 (PDT) To: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: cvs commit: src/crypto/telnet/telnetd ext.h slc.c state.c utility.c X-FreeBSD-CVS-Branch: HEAD Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG ru 2001/07/20 05:02:30 PDT Modified files: crypto/telnet/telnetd ext.h slc.c state.c utility.c Log: More potential buffer overflow fixes. o Fixed `nfrontp' calculations in output_data(). If `remaining' is initially zero, it was possible for `nfrontp' to be decremented. Noticed by: dillon o Replaced leaking writenet() with output_datalen(): : * writenet : * : * Just a handy little function to write a bit of raw data to the net. : * It will force a transmit of the buffer if necessary : * : * arguments : * ptr - A pointer to a character string to write : * len - How many bytes to write : */ : void : writenet(ptr, len) : register unsigned char *ptr; : register int len; : { : /* flush buffer if no room for new data) */ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ : if ((&netobuf[BUFSIZ] - nfrontp) < len) { : /* if this fails, don't worry, buffer is a little big */ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ : netflush(); : } : : memmove(nfrontp, ptr, len); : nfrontp += len; : : } /* end of writenet */ What an irony! :-) o Optimized output_datalen() a bit. Revision Changes Path 1.6 +3 -4 src/crypto/telnet/telnetd/ext.h 1.6 +2 -2 src/crypto/telnet/telnetd/slc.c 1.8 +5 -5 src/crypto/telnet/telnetd/state.c 1.9 +1 -28 src/crypto/telnet/telnetd/utility.c To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message