🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #19598

Re: ANNOUNCE: INN 1.5.1 buffer overflow patch

#19598
From: Jeff Garzik
Date: Thu, 24 Jul 1997 00:00
30 lines
1473 bytes
(cc'd to author)

Miquel van Smoorenburg wrote:
>        In the case where the length of src is less than  that  of
>        n, the remainder of dest will be padded with nulls.
> 
> So I think that
> 
>         strncpy(p, "running", sizeof(buff) - strlen(buff) - 1)
> 
> does indeed put a \0 at the end of the string and the
> 
>         buff[sizeof(buff) - 1] = '\0';
> 
> is superfluous.


Read your manpage....  strncpy will never insert a terminating null past
the size arg.  Doing so would defeat the purpose of strncpy().  Doing a 

	buff[sizeof(buff) - 1] = '\0';

after EACH and EVERY strncpy() is quite necessary.
-- 
Jeff Garzik					   Quality news feeds
News Administrator		       INN Technical info, Consulting
Spinne, Inc.				http://www.spinne.com/usenet/

Technical Details
Message-ID: <33D7E146.95CD5BC@spinne.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
References: <5r81l9$27j$1@holodeck.cistron.nl> <5r8944$7d3$1@news1.epix.net> <5r8a6h$30f$1@holodeck.cistron.nl>

Show Full Headers
Complete Article Headers
Message-ID: <33D7E146.95CD5BC@spinne.com>
Subject: Re: ANNOUNCE: INN 1.5.1 buffer overflow patch
Date: Thu, 24 Jul 1997 00:00:00 +0000
From: Jeff Garzik <jeff.garzik@spinne.com>
References: <5r81l9$27j$1@holodeck.cistron.nl> <5r8944$7d3$1@news1.epix.net> <5r8a6h$30f$1@holodeck.cistron.nl>
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: 258651012
To: Miquel van Smoorenburg <miquels@cistron.nl>
Organization: Spinne http://spinne.com
Newsgroups: news.software.nntp