🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.readers
1 messages
1 total messages Started by Ben Golding Tue, 30 Aug 1994 03:35
Rn/trn-3.5/strn092 core dumping on articles with long headers (w fix)
#11121
Author: 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);
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads