From be43e6c730916e79e6861531ad38f61ef55ad59f Mon Sep 17 00:00:00 2001 From: Gregory A Lundberg Date: Sun, 2 Oct 2016 01:09:29 -0500 Subject: [PATCH] Fix bug: Index out of bounds Revert this commit. There was no off-by-one but this commit created one. Commit commit 299a29f99a84767731dbadd540712d1a37e5e10d Author: Alexander van Gessel Date: Mon Dec 2 17:55:02 2013 +0100 Fix an off-by-one past-the-end buffer read in lua Found by coverity --- src/lua/llex.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lua/llex.cpp b/src/lua/llex.cpp index 7bd5ac2c2819..cf1d4ad71001 100644 --- a/src/lua/llex.cpp +++ b/src/lua/llex.cpp @@ -72,7 +72,7 @@ void luaX_init (lua_State *L) { const char *luaX_token2str (LexState *ls, int token) { - if (token < FIRST_RESERVED - 1) { /* single-byte symbols? */ + if (token < FIRST_RESERVED) { /* single-byte symbols? */ 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);