Article View: news.software.readers
Article #106826[TIN] 1.4.5 patch for potential memory clobber
From: Russ Allbery
Date: Thu, 25 Jul 2002 17:08
Date: Thu, 25 Jul 2002 17:08
22 lines
1795 bytes
1795 bytes
One of my users reported tin being killed by libsafe for a stack overflow
after we upgraded to 1.4.5. Running tin under purify revealed the
following coding bug in the config parser; strlen was accidentally used
instead of sizeof.
Here's a patch:
--- tin-1.4.5/src/config.c.orig 2000-12-17 15:31:21.000001000 -0800
+++ tin-1.4.5/src/config.c 2002-07-25 09:20:15.000002000 -0700
@@ -53,7 +53,7 @@
char foo[60];
char bar[120]; /* should be enought; snprintf() would be handy */
- my_strncpy(foo, txt_tinrc_header, strlen(foo)-1);
+ my_strncpy(foo, txt_tinrc_header, sizeof(foo)-1);
sprintf(bar, foo, PRODUCT, TINRC_VERSION);
if (strncmp(buf, bar, MIN(strlen(bar),strlen(buf))) == 0)
--
Russ Allbery (rra@stanford.edu) <http://www.eyrie.org/~eagle/>
Technical Details
Message-ID:
<ylptxbu445.fsf@windlord.stanford.edu>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.mbox.zip!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!nntp.stanford.edu!not-for-mailShow Full Headers
Complete Article Headers
Message-ID: <ylptxbu445.fsf@windlord.stanford.edu> Subject: [TIN] 1.4.5 patch for potential memory clobber Date: Thu, 25 Jul 2002 10:08:58 -0700 From: Russ Allbery <rra@stanford.edu> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.mbox.zip!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!nntp.stanford.edu!not-for-mail Newsgroups: news.software.readers Organization: The Eyrie Lines: 21 NNTP-Posting-Host: windlord.stanford.edu Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: news.Stanford.EDU 1027616938 26592 171.64.13.23 (25 Jul 2002 17:08:58 GMT) X-Complaints-To: news@news.stanford.edu User-Agent: Gnus/5.090005 (Oort Gnus v0.05) XEmacs/21.4 (Honest Recruiter, sparc-sun-solaris2.6) Cancel-Lock: sha1:vKklpXsdQJ28Mqmw5bigQ/jfISg=