Skip to content

Commit

Permalink
Fix bug: Index out of bounds
Browse files Browse the repository at this point in the history
Revert this commit. There was no off-by-one but this commit created one.

Commit commit 299a29f
Author: Alexander van Gessel <ai0867@gmail.com>
Date:   Mon Dec 2 17:55:02 2013 +0100

    Fix an off-by-one past-the-end buffer read in lua

    Found by coverity
  • Loading branch information
GregoryLundberg committed Oct 10, 2016
1 parent 196a044 commit be43e6c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lua/llex.cpp
Expand Up @@ -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);
Expand Down

0 comments on commit be43e6c

Please sign in to comment.