Grep bug

utzoo!decvax!watmath!kwlalonde utzoo!decvax!watmath!kwlalonde
Tue Mar 30 20:59:38 AEST 1982


Grep recognises syntactically incorrect patterns, such as '[', and
prints a diagnostic.  It then goes ahead and tries to execute its compiled
pattern on the input, resulting in infinite loops and other uglies.
A fix is to exit after the diagnostic.
	
	diff oldgrep.c newgrep.c
	186a187
	> 	exit(2);
						Ken Lalonde



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