🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

2 total messages Started by Sam Kendall Wed, 20 Nov 1985 02:48
readnews (2.10.3 4.3bsd-beta 6/6/85) bug + workaround
#3
Author: Sam Kendall
Date: Wed, 20 Nov 1985 02:48
21 lines
1389 bytes
I recently rmgroup'd locally a bunch of obsolete newsgroups and added a
bunch of new ones to "active".  After this, readnews dumped core.  This
is on a Codata 68000 machine, which will dump core for indirection of
NULL, and that's just what the bug turned out to be.  The indicated
subexpression was NULL:

rfuncs.c, line 569:
		if (lentab[i] == len && strncmp(name, rcline[i], len) == 0)
						      ^^^^^^^^^

I don't have a fix, but after I deleted references to the obsolete
newsgroups in my .newsrc, readnews ran fine.

inews is 2.10.2 but readnews is 2.10.3 4.3bsd-beta 6/6/85 on this
system.

----
Sam Kendall					"This bug found with
Delft Consulting Corp.				 The Bcc Compiler, a
(212) 243-8700					 'C' runtime checker."
{allegra, seismo!cmcl2, ihnp4}!delftcc!sam
Re: readnews (2.10.3 4.3bsd-beta 6/6/85) bug fix
#6
Author: John Gilmore
Date: Fri, 22 Nov 1985 22:04
72 lines
2836 bytes
In article <102@delftcc.UUCP>, sam@delftcc.UUCP (Sam Kendall) writes:
> I recently rmgroup'd locally a bunch of obsolete newsgroups and added a
> bunch of new ones to "active".  After this, readnews dumped core.
> rfuncs.c, line 569:
> 		if (lentab[i] == len && strncmp(name, rcline[i], len) == 0)

Here is the fix.  I sent it back to be included in the next news release.
The problem is that rcline[i] gets freed but lentab[i] still 
claims that the line exists.  The fix makes lentab[] public so we can
fix it, and zeros the relevant entry so it won't compare equal in the above
line.

The problem occurs if either you put the same newsgroup twice in .newsrc,
or if a newsgroup from .newsrc doesn't exist in the active file.

*** /tmp/geta15917	Fri Nov 22 13:57:26 1985
--- rfuncs.c      	Fri Nov 22 13:57:27 1985
***************
*** 10,15
  
  #include "rparams.h"
  
  long nngsize;	/* The next upcoming value of ngsize. */
  long nminartno;	/* Smallest article number in this group */
  int BITMAPSIZE = 0;

--- 10,17 -----
  
  #include "rparams.h"
  
+ char	lentab[LINES];		/* Length of newsgroup name for each rcline */
+ 
  long nngsize;	/* The next upcoming value of ngsize. */
  long nminartno;	/* Smallest article number in this group */
  int BITMAPSIZE = 0;
***************
*** 553,559
  	register int	top;
  	register int	len;
  	static int	prev;
- 	static char	lentab[LINES];
  	static int	didthru;
  
  	for ( ; didthru <= line; ++didthru)

--- 555,560 -----
  	register int	top;
  	register int	len;
  	static int	prev;
  	static int	didthru;
  
  	for ( ; didthru <= line; ++didthru)
***************
*** 685,690
  	/* copy active to newactive, in the new order */
  	for (i = 0; i < nlines; i++) {
  		while (++lastline < tp->rcindex) {
  			free(rcline[lastline]);
  			rcline[lastline] = NULL;
  		}

--- 686,695 -----
  	/* copy active to newactive, in the new order */
  	for (i = 0; i < nlines; i++) {
  		while (++lastline < tp->rcindex) {
+ 			fprintf(stderr,
+ 				"Dup .newsrc line or bad newsgroup: %s\n",
+ 				rcline[lastline]);
+ 			lentab[lastline] = 0;
  			free(rcline[lastline]);
  			rcline[lastline] = NULL;
  		}
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