fix invalid read for ksh93-style base-1 integers

(valgrind; reported by fmunozs via IRC, thanks!)
This commit is contained in:
tg 2016-03-01 18:29:38 +00:00
parent 819229fa50
commit 7c93759f66
1 changed files with 5 additions and 2 deletions

7
expr.c
View File

@ -23,7 +23,7 @@
#include "sh.h"
__RCSID("$MirOS: src/bin/mksh/expr.c,v 1.82 2016/02/26 18:48:12 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/expr.c,v 1.83 2016/03/01 18:29:38 tg Exp $");
/* the order of these enums is constrained by the order of opinfo[] */
enum token {
@ -665,7 +665,10 @@ exprtoken(Expr_state *es)
goto process_tvar;
#ifndef MKSH_SMALL
} else if (c == '\'') {
++cp;
if (*++cp == '\0') {
es->tok = END;
evalerr(es, ET_UNEXPECTED, NULL);
}
cp += utf_ptradj(cp);
if (*cp++ != '\'')
evalerr(es, ET_STR,