[net.bugs.4bsd] "dereferencing NULL" bugs in tip for 4.2bsd

smk@axiom.UUCP (Steven M. Kramer) (06/12/85)

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@mitre-bedford					(MIL)