Article View: news.software.nntp
Article #22300Re: More luser "long newgroup's" issued
From: Doug Ledford
Date: Mon, 13 Oct 1997 00:00
Date: Mon, 13 Oct 1997 00:00
43 lines
3077 bytes
3077 bytes
Marc Slemko (marcs@znep.com) wrote: : In <61r9cm$vhb$1@news.dialnet.net> dledford@news.dialnet.net (Doug Ledford) writes: : [...] : >exactly 24. This means that if strlen(Name) + strlen(Rest) == SMBUF - 24, : >then the test fails, we perform the snprintf (with no buffer overflow as : >intended), then we proceed further on. However, since the number of : >characters added was 24, and SMBUF only had 24 characters to spare, we end : >up with no NULL terminator. Not so bad, until two lines later when we : >set an IOVEC based upon strlen(buff). Without the NULL terminator, and : >having already done an iovset on iov[0], we are gauranteed that the strlen : >will return a value larger than SMBUF. We are then gauranteed to corrupt : >our active file. Nice. : No. snprintf() always adds a null terminator. : strncpy doesn't. I stand corrected, however, that doesn't change the fact that something just got chopped in this instance. If we include the NULL terminator, then we now have the problem of not everything fitting, which very well could be our terminating new line for the active file, which isn't a much better solution than what we had before (depending on the particular function where this happens, the problem could be worse if the code that later reads this file depends upon that newline, such as the active file code does). So, what happens when you get several of the large groups in a row, then you get an active file with multiple entries on a single line and still have a corrupted file as far as Inn is concerned. So, it gets NULL terminated, at the expense of losing one character, and still isn't correct. -- ***************************************************************************** * Doug Ledford * Unix, Novell, Dos, Windows 3.x, * * dledford@dialnet.net 873-DIAL * WfW, Windows 95 & NT Technician * * PPP access $14.95/month ***************************************** * Springfield, MO and surrounding * Usenet news, e-mail and shell account.* * communities. Sign-up online at * Web page creation and hosting, other * * 873-9000 V.34 * services available, call for info. * *****************************************************************************
Technical Details
Message-ID:
<61ru7i$9a8$1@news.dialnet.net>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mailReferences:
<61jna5$1jv$1@earth.execpc.com> <61jp17$db8$0@207.14.113.2> <61r9cm$vhb$1@news.dialnet.net> <61ror1$5di$1@scanner.worldgate.com>Show Full Headers
Complete Article Headers
Message-ID: <61ru7i$9a8$1@news.dialnet.net> Subject: Re: More luser "long newgroup's" issued Date: Mon, 13 Oct 1997 00:00:00 +0000 From: dledford@news.dialnet.net (Doug Ledford) References: <61jna5$1jv$1@earth.execpc.com> <61jp17$db8$0@207.14.113.2> <61r9cm$vhb$1@news.dialnet.net> <61ror1$5di$1@scanner.worldgate.com> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mail X-Deja-AN: 279946482 X-Complaints-To: news@news.dialnet.net X-Trace: news.dialnet.net 876706866 9544 (None) 206.65.248.4 Organization: DialNet USENET News Service. Newsgroups: news.software.nntp