mirror of
https://github.com/luau-lang/luau.git
synced 2025-01-19 17:28:06 +00:00
Explicitly cast size_t to uint64_t in buffer_readbits / buffer_writebits
This commit is contained in:
parent
a0ed331da0
commit
ba71ff135b
1 changed files with 2 additions and 2 deletions
|
@ -262,7 +262,7 @@ static int buffer_readbits(lua_State* L)
|
|||
if (unsigned(bitcount) > 32)
|
||||
luaL_error(L, "bit count is out of range of [0; 32]");
|
||||
|
||||
if (uint64_t(bitoffset + bitcount) > len * 8)
|
||||
if (uint64_t(bitoffset + bitcount) > uint64_t(len) * 8)
|
||||
luaL_error(L, "buffer access out of bounds");
|
||||
|
||||
unsigned startbyte = unsigned(bitoffset / 8);
|
||||
|
@ -292,7 +292,7 @@ static int buffer_writebits(lua_State* L)
|
|||
if (unsigned(bitcount) > 32)
|
||||
luaL_error(L, "bit count is out of range of [0; 32]");
|
||||
|
||||
if (uint64_t(bitoffset + bitcount) > len * 8)
|
||||
if (uint64_t(bitoffset + bitcount) > uint64_t(len) * 8)
|
||||
luaL_error(L, "buffer access out of bounds");
|
||||
|
||||
unsigned startbyte = unsigned(bitoffset / 8);
|
||||
|
|
Loading…
Reference in a new issue