From 61d5997b586a28f79d54b28ce6963b643dff6e9e Mon Sep 17 00:00:00 2001 From: Brian Foley Date: Sat, 15 Oct 2016 14:45:40 +0100 Subject: awk: fix segfault on for loop syntax error Parsing "for()" segfaults as awk fails to find loop iteration expressions. Signed-off-by: Brian Foley Signed-off-by: Denys Vlasenko --- testsuite/awk.tests | 3 +++ 1 file changed, 3 insertions(+) (limited to 'testsuite/awk.tests') diff --git a/testsuite/awk.tests b/testsuite/awk.tests index adab4ae1e..82937bc10 100755 --- a/testsuite/awk.tests +++ b/testsuite/awk.tests @@ -316,6 +316,9 @@ testing "awk continue" \ "" \ 'BEGIN { if (1) continue; else a = 1 }' +testing "awk handles invalid for loop" \ + "awk '{ for() }' 2>&1" "awk: cmd. line:1: Unexpected token\n" "" "" + # testing "description" "command" "result" "infile" "stdin" exit $FAILCOUNT -- cgit v1.2.3