git: 9front

Download patch

ref: 07c8338b6c1ea0b150725784eaad7cf1f5ef75b9
parent: 09eb41c2bb8aba561cba9dd4ef9ba7c38cb63f97
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Fri Jun 2 15:03:37 EDT 2017

awk: handle bad/incomplete input in maketab (thanks kenji arisawa)

--- a/sys/src/cmd/awk/maketab.c
+++ b/sys/src/cmd/awk/maketab.c
@@ -133,8 +133,8 @@
 	i = 0;
 	while ((buf = Brdline(fp, '\n')) != nil) {
 		buf[Blinelen(fp)-1] = '\0';
-		tokenize(buf, toks, 3);
-		if (toks[0] == nil || strcmp("#define", toks[0]) != 0)	/* not a valid #define */
+		if (tokenize(buf, toks, 3) != 3
+		|| strcmp("#define", toks[0]) != 0)	/* not a valid #define */
 			continue;
 		tok = strtol(toks[2], nil, 10);
 		if (tok < FIRSTTOKEN || tok > LASTTOKEN) {
--