Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: 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 Xref: mnetor news.software.b:18 net.sources.bugs:889 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 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