Skip to content

Commit 0066172

Browse files
Fix lua bit.tohex (CVE-2024-31449)
Fix lua bit.tohex (CVE-2024-31449)
1 parent a47f5e4 commit 0066172

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

app/redis-6.2.6/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)