Fix an off-by-one past-the-end buffer read in lua
Found by coverity
This commit is contained in:
parent
855d8116d1
commit
299a29f99a
1 changed files with 1 additions and 1 deletions
|
@ -72,7 +72,7 @@ void luaX_init (lua_State *L) {
|
|||
|
||||
|
||||
const char *luaX_token2str (LexState *ls, int token) {
|
||||
if (token < FIRST_RESERVED) {
|
||||
if (token < FIRST_RESERVED - 1) {
|
||||
lua_assert(token == cast(unsigned char, token));
|
||||
return (lisprint(token)) ? luaO_pushfstring(ls->L, LUA_QL("%c"), token) :
|
||||
luaO_pushfstring(ls->L, "char(%d)", token);
|
||||
|
|
Loading…
Add table
Reference in a new issue