awk: Guard pointer chasing when parsing ternary expressions.
authorBrian Foley <bpfoley@google.com>
Tue, 1 Jan 2019 21:40:58 +0000 (13:40 -0800)
committerDenys Vlasenko <vda.linux@googlemail.com>
Mon, 21 Jan 2019 11:55:49 +0000 (12:55 +0100)
commitdac15a10accc6921d1559d254ceed9fe9d092ddf
tree2c0082d5b5b03df07d26d048c587fdae0a22700c
parent11cb9eeffec0e2575c8722e83de3116f81b61b4f
awk: Guard pointer chasing when parsing ternary expressions.

Avoids an uninit pointer deref for some malformed ternary exprs.

Add a test that would crash in busybox before this fix.

Signed-off-by: Brian Foley <bpfoley@google.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
editors/awk.c
testsuite/awk.tests