🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #11121

Rn/trn-3.5/strn092 core dumping on articles with long headers (w fix)

#11121
From: Ben Golding
Date: Tue, 30 Aug 1994 03:35
39 lines
2168 bytes
A user reported that trn was dumping core when it tried to read article
<33k309$lt5@usenet.srv.cis.pitt.edu> which is a misformatted article
which has spaces in the first column most of the way through the
message.  This makes the headers about 12k long and this causes a part
of the newsreader to be used that doesn't often happen.

The problem is that bp is used as a pointer into headbuf.  When headbuf
is realloc'ed it can be moved but bp wasn't being moved as well.  This
patch fixes this problem and we can finally read the offending
article.

The attached patch refers to trn-3.5 sources but the same bug appears
in strn as well; I haven't patched that yet.

	Ben.
--
*** .save/head.c	Tue Aug 30 13:11:11 1994
--- head.c	Tue Aug 30 13:11:49 1994
***************
*** 262,269 ****
      bp = headbuf;
      while (in_header) {
  	if (headbuf_size < artpos + LBUFLEN) {
  	    headbuf_size += LBUFLEN * 4;
! 	    headbuf = saferealloc(headbuf,headbuf_size);
  	}
  #ifdef USE_NNTP
  	nntp_gets(bp,LBUFLEN);
--- 262,271 ----
      bp = headbuf;
      while (in_header) {
  	if (headbuf_size < artpos + LBUFLEN) {
+ 	    len = bp - headbuf;
  	    headbuf_size += LBUFLEN * 4;
! 	    bp = headbuf = saferealloc(headbuf,headbuf_size);
! 	    bp += len;
  	}
  #ifdef USE_NNTP
  	nntp_gets(bp,LBUFLEN);
Technical Details
Message-ID: <33u9ej$c4c@melang.connect.com.au>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!archive!mbox2nntp-news.software.readers.mbox.zip!bga.com!news.sprintlink.net!redstone.interpath.net!ddsw1!news.kei.com!uhog.mit.edu!europa.eng.gtefsd.com!library.ucla.edu!agate!msuinfo!harbinger.cc.monash.edu.au!yarrina.connect.com.au!warrane.connect.com.au!melang.connect.com.au!not-for-mail

Show Full Headers
Complete Article Headers
Message-ID: <33u9ej$c4c@melang.connect.com.au>
Subject: Rn/trn-3.5/strn092 core dumping on articles with long headers (w fix)
Date: Tue, 30 Aug 1994 03:35:47 +0000
From: bgg@connect.com.au (Ben Golding)
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!archive!mbox2nntp-news.software.readers.mbox.zip!bga.com!news.sprintlink.net!redstone.interpath.net!ddsw1!news.kei.com!uhog.mit.edu!europa.eng.gtefsd.com!library.ucla.edu!agate!msuinfo!harbinger.cc.monash.edu.au!yarrina.connect.com.au!warrane.connect.com.au!melang.connect.com.au!not-for-mail
Newsgroups: news.software.readers
Organization: Connect.com.au P/L, Sydney, Australia
Lines: 39
NNTP-Posting-Host: melang.connect.com.au