fix invalid read for ksh93-style base-1 integers
(valgrind; reported by fmunozs via IRC, thanks!)
This commit is contained in:
parent
819229fa50
commit
7c93759f66
7
expr.c
7
expr.c
@ -23,7 +23,7 @@
|
|||||||
|
|
||||||
#include "sh.h"
|
#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[] */
|
/* the order of these enums is constrained by the order of opinfo[] */
|
||||||
enum token {
|
enum token {
|
||||||
@ -665,7 +665,10 @@ exprtoken(Expr_state *es)
|
|||||||
goto process_tvar;
|
goto process_tvar;
|
||||||
#ifndef MKSH_SMALL
|
#ifndef MKSH_SMALL
|
||||||
} else if (c == '\'') {
|
} else if (c == '\'') {
|
||||||
++cp;
|
if (*++cp == '\0') {
|
||||||
|
es->tok = END;
|
||||||
|
evalerr(es, ET_UNEXPECTED, NULL);
|
||||||
|
}
|
||||||
cp += utf_ptradj(cp);
|
cp += utf_ptradj(cp);
|
||||||
if (*cp++ != '\'')
|
if (*cp++ != '\'')
|
||||||
evalerr(es, ET_STR,
|
evalerr(es, ET_STR,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user