Skip to content

Commit

Permalink
Fix an off-by-one past-the-end buffer read in lua
Browse files Browse the repository at this point in the history
Found by coverity
  • Loading branch information
AI0867 committed Dec 2, 2013
1 parent 855d811 commit 299a29f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lua/llex.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 299a29f

Please sign in to comment.