Article View: news.software.nntp
Article #19646Re: ANNOUNCE: INN 1.5.1 buffer overflow patch
From: Miquel van Smoorenburg
Date: Fri, 25 Jul 1997 00:00
Date: Fri, 25 Jul 1997 00:00
32 lines
1912 bytes
1912 bytes
In article <5r9o69$q72$1@flea.best.net>, Matt Dillon <dillon@best.net> wrote: >:In article <5r9m1a$6oe$1@holodeck.cistron.nl>, >:Miquel van Smoorenburg <miquels@cistron.nl> wrote: >:> >:>I've fixed my patch to use >:> >:>#define STRCPY(dst, src) \ >:> (dst[sizeof(dst) - 1] = 0, strncpy(dst, src, sizeof(dst) - 1)) >:> >:>The first part sets the last byte to \0, the strncpy copies one byte less >:>then the dst length so the last \0 does not get overwritten. >:> > This is an extremely dangerous macro. > > -Matt I welcome constructive critisism, that is needed to get INN into gear. The patch I made may not be the final solution, so all input and help is appreciated. So please explain what you mean... I did not say that one should blindly replace all strcpy's with STRCPY, ofcourse. Perhaps I should have chosen another name. `dst' HAS to be a statically or stack allocated string, and not a pointer. Mike. -- | Miquel van Smoorenburg | "I need more space" "Well, why not move to Texas" | | miquels@cistron.nl | "No, on my account, stupid." "Stupid? Uh-oh.." | | PGP fingerprint: FE 66 52 4F CD 59 A5 36 7F 39 8B 20 F1 D6 74 02 |
Technical Details
Message-ID:
<5r9rh5$7aa$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-mailReferences:
<5r81l9$27j$1@holodeck.cistron.nl> <33D7E146.95CD5BC@spinne.com> <5r9m1a$6oe$1@holodeck.cistron.nl> <5r9o69$q72$1@flea.best.net>Show Full Headers
Complete Article Headers
Message-ID: <5r9rh5$7aa$1@holodeck.cistron.nl> Subject: Re: ANNOUNCE: INN 1.5.1 buffer overflow patch Date: Fri, 25 Jul 1997 00:00:00 +0000 From: miquels@cistron.nl (Miquel van Smoorenburg) References: <5r81l9$27j$1@holodeck.cistron.nl> <33D7E146.95CD5BC@spinne.com> <5r9m1a$6oe$1@holodeck.cistron.nl> <5r9o69$q72$1@flea.best.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-mail X-Deja-AN: 258709762 Organization: Cistron Internet Services B.V. X-Server-Date: 25 Jul 1997 09:26:55 GMT Newsgroups: news.software.nntp