Skip to content

Commit 40d13d1

Browse files
committed
Fix Lua stack overflow issue as described in #905
1 parent 603ebb2 commit 40d13d1

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

deps/lua/src/lua_bit.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ static int bit_tohex(lua_State *L)
131131
const char *hexdigits = "0123456789abcdef";
132132
char buf[8];
133133
int i;
134+
if (n == INT32_MIN) n = INT32_MIN+1;
134135
if (n < 0) { n = -n; hexdigits = "0123456789ABCDEF"; }
135136
if (n > 8) n = 8;
136137
for (i = (int)n; --i >= 0; ) { buf[i] = hexdigits[b & 15]; b >>= 4; }

0 commit comments

Comments
 (0)