"dereferencing NULL" bugs in tip for 4.2bsd

Steven M. Kramer smk at axiom.UUCP
Thu Jun 13 01:17:49 AEST 1985


In remote.c, there is a point where the termcap-like parameters are
obtained.  As is the case with most termcap-derived programs written
for the VAX, there are dereferencing problems.  The old lines are:
	if (*RE == NULL)
		RE = (char *)"tip.record";
	if (*EX == NULL)
		EX = (char *)"\t\n\b\f";

Before RE and EX are checked for NULL, they are dereferenced.  The obvious
fix is:

	/*
	 * This is a dereferencing NULL problem.  First, check
	 * to make sure the value itself is not null.
	 * Steve Kramer  Axiom  6/11/85
	 */
	if ((RE == NULL) || (*RE == NULL))
		RE = (char *)"tip.record";
	if ((EX == NULL) || (*EX == NULL))
		EX = (char *)"\t\n\b\f";
-- 
	--steve kramer
	{allegra,genrad,ihnp4,utzoo,philabs,uw-beaver}!linus!axiom!smk	(UUCP)
	linus!axiom!smk at mitre-bedford					(MIL)



More information about the Comp.bugs.4bsd.ucb-fixes mailing list