aboutsummaryrefslogtreecommitdiff
path: root/editors
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2020-06-09 01:33:54 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2020-06-09 01:33:54 +0200
commit6f7a0096496a5a9e90638dc01e947015cc776110 (patch)
tree9c069ee55413ec7acef2d1e152859b0f14c9b11f /editors
parent45fa3f18adf57ef9d743038743d9c90573aeeb91 (diff)
downloadbusybox-6f7a0096496a5a9e90638dc01e947015cc776110.tar.gz
awk: disallow "str"++, closes bug 12981
function old new delta parse_expr 887 896 +9 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'editors')
-rw-r--r--editors/awk.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/editors/awk.c b/editors/awk.c
index 70df2fdb4..f7451ae32 100644
--- a/editors/awk.c
+++ b/editors/awk.c
@@ -1359,8 +1359,10 @@ static node *parse_expr(uint32_t iexp)
v = cn->l.v = xzalloc(sizeof(var));
if (tc & TC_NUMBER)
setvar_i(v, t_double);
- else
+ else {
setvar_s(v, t_string);
+ xtc &= ~TC_UOPPOST; /* "str"++ is not allowed */
+ }
break;
case TC_REGEXP: