🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.b
Article #5125

rn 4.3 patch #37

#5125
From: Larry Wall
Date: Mon, 17 Nov 1986 20:08
82 lines
2851 bytes
System: rn version 4.3
Patch #: 37
Priority: depends
Subject: Rn dumps core on appending line to .newsrc
From: mn-at1!alan (Alan Klietz)

Description:
	Rn dumps core on adding a new newsgroup to the
	.newsrc file.
	
Repeat by:
	Create a new newsgroup and then run rn.
	It may dump core depending on your machine type.

Fix:
	The writelast() procedure in last.c does not check
	the ngname string before before flushing out the last
	line of the .newsrc file.  In certain circumstances
	the ngname string is NULL.  On machines which do
	not have *(char *)0 mapped into the address space
	rn will halt with a segment violation error.

	The fix is to check the string before doing the write.

	From rn, say "| patch -d DIR", where DIR is your rn source directory.
	Outside of rn, say "cd DIR; patch <thisarticle".  If you don't have
	the patch program, apply the following by hand, or get patch.

	If patch indicates that patchlevel is the wrong version, you may need
	to apply one or more previous patches, or the patch may already
	have been applied.  See the patchlevel file to find out what has or
	has not been applied.  In any event, don't continue with the patch.

	[Note, I cannot test this patch because rn is being rewritten--law]

	If you are missing previous patches they can be obtained from me:

	Larry Wall
	{allegra,burdvax,cbosgd,hplabs,ihnp4,sdcsvax}!sdcrdcf!lwall

	If you send a mail message of the following form it will greatly speed
	processing:

	Subject: Command
	@SH mailpatch PATH rn 4.3 LIST

	where PATH is a return path FROM ME TO YOU in bang notation, and LIST
	is a list of one or more patches you need, separated by spaces, commas
	and/or hyphens.

Index: patchlevel
Prereq: 36
1c1
< Patch #: 36
---
> Patch #: 37

Index: last.c
Prereq: 
*** last.c.orig	Sun Nov  9 23:11:11 1986
--- last.c	Tue Nov 11 17:09:40 1986
***************
*** 44,50
  writelast()
  {
      if ((tmpfp = fopen(lastname,"w")) != Nullfp) {
! 	fprintf(tmpfp,"%s\n%ld\n%ld\n",ngname,(long)lasttime,(long)lastactsiz);
  	fclose(tmpfp);
      }
      else

--- 44,52 -----
  writelast()
  {
      if ((tmpfp = fopen(lastname,"w")) != Nullfp) {
! 	if (ngname != Nullch)
! 		fprintf(tmpfp,"%s\n%ld\n%ld\n",
! 			ngname,(long)lasttime,(long)lastactsiz);
  	fclose(tmpfp);
      }
      else
Technical Details
Message-ID: <3435@sdcrdcf.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!mnetor!seismo!rutgers!sri-unix!hplabs!sdcrdcf!lwall

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!mnetor!seismo!rutgers!sri-unix!hplabs!sdcrdcf!lwall
From: lwall@sdcrdcf.UUCP (Larry Wall)
Newsgroups: news.software.b,net.sources.bugs
Subject: rn 4.3 patch #37
Message-ID: <3435@sdcrdcf.UUCP>
Date: Mon, 17-Nov-86 15:08:40 EST
Article-I.D.: sdcrdcf.3435
Posted: Mon Nov 17 15:08:40 1986
Date-Received: Mon, 17-Nov-86 22:35:00 EST
Organization: System Development Corporation R&D, Santa Monica
Lines: 82