Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site sdcrdcf.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!genrad!decvax!ittatc!dcdwest!sdcsvax!sdcrdcf!lwall From: lwall@sdcrdcf.UUCP (Larry Wall) Newsgroups: net.sources.bugs Subject: rn 4.3 patch #22 Message-ID: <2181@sdcrdcf.UUCP> Date: Tue, 23-Jul-85 20:50:43 EDT Article-I.D.: sdcrdcf.2181 Posted: Tue Jul 23 20:50:43 1985 Date-Received: Sat, 27-Jul-85 04:02:12 EDT Organization: System Development Corp. R+D, Santa Monica Lines: 86 System: rn version 4.3 Patch #: 22 Priority: MEDIUM Subject: Patch #14 causes malloc mixups on "rn -c" From: dsp@ptsfa.UUCP (David St. Pierre), landauer@drivax.UUCP (Doug Landauer) Description: Patch #14 attempted to speed up "rn -c" by using a static buffer instead of an malloc'ed one. Unfortunately, buried deep down in a routine called checkexpired there was an unguarded call to free(). This can confuse malloc if there is more than one newsgroup with expired articles to account for. Fix: From rn, say "| patch -d DIR", where DIR is your rn source directory. Outside of rn, say "cd DIR; patch Patch #: 22 Index: rcln.c Prereq: 4.3 *** rcln.c.old Tue Jul 23 17:40:30 1985 --- rcln.c Tue Jul 23 17:40:33 1985 *************** *** 1,4 ! /* $Header: rcln.c,v 4.3 85/05/01 11:45:36 lwall Exp $ * * $Log: rcln.c,v $ * Revision 4.3 85/05/01 11:45:36 lwall --- 1,4 ----- ! /* $Header: rcln.c,v 4.3.1.2 85/07/23 17:39:08 lwall Exp $ * * $Log: rcln.c,v $ * Revision 4.3.1.2 85/07/23 17:39:08 lwall *************** *** 1,6 /* $Header: rcln.c,v 4.3 85/05/01 11:45:36 lwall Exp $ * * $Log: rcln.c,v $ * Revision 4.3 85/05/01 11:45:36 lwall * Baseline for release with 4.3bsd. * --- 1,12 ----- /* $Header: rcln.c,v 4.3.1.2 85/07/23 17:39:08 lwall Exp $ * * $Log: rcln.c,v $ + * Revision 4.3.1.2 85/07/23 17:39:08 lwall + * Oops, was freeing a static buf on -c in checkexpired. + * + * Revision 4.3.1.1 85/05/10 11:37:08 lwall + * Branch for patches. + * * Revision 4.3 85/05/01 11:45:36 lwall * Baseline for release with 4.3bsd. * *************** *** 426,432 (MEM_SIZE)(rcnums[ngnum] + strlen(newnum) + 1)); } else { ! free(rcline[ngnum]); rcline[ngnum] = mbuf; } --- 432,439 ----- (MEM_SIZE)(rcnums[ngnum] + strlen(newnum) + 1)); } else { ! if (!checkflag) ! free(rcline[ngnum]); rcline[ngnum] = mbuf; }