Subject: bin/138: awk "" dumps core
To: None <gnats-admin>
From: Matthieu Herrb <matthieu@laas.fr>
List: netbsd-bugs
Date: 02/23/1994 12:50:03
>Number:         138
>Category:       bin
>Synopsis:       awk "" dumps core
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    gnats-admin (Utility Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Feb 23 12:50:02 1994
>Originator:     Matthieu Herrb
>Organization:
	LAAS/CNRS
	Toulouse France
>Release:        20/02 NetBSD-current
>Environment:
	gawk 2.15 patchlevel 4
System: NetBSD cougar 0.9a COUGAR#4 i386


>Description:
	Calling awk with an empty string as 1st parameter causes an internal
	error and a core dump.

	Also submitted to Gnu awk mainteners.

>How-To-Repeat:
	from C-shell:
		awk ""
>Fix:
	With this fix, awk produces a syntax error in the same conditions. 

--- awk.y~      Thu Feb 17 11:11:06 1994
+++ awk.y       Tue Feb 22 21:26:12 1994
@@ -854,7 +854,7 @@
 
        errcount++;
        /* Find the current line in the input file */
-       if (lexptr) {
+       if (lexptr && lexeme) {
                if (!thisline) {
                        cp = lexeme;
                        if (*cp == '\n') {

>Audit-Trail:
>Unformatted:


------------------------------------------------------------------------------