mirror of
https://github.com/neovim/neovim.git
synced 2024-12-19 10:45:16 -07:00
fix: buffer overrun in lmpack_session_receive
The offset was not taken into account when calculating the remaining buffer size.
This commit is contained in:
parent
cbb7632aa0
commit
d6483793e1
@ -882,7 +882,9 @@ static int lmpack_session_receive(lua_State *L)
|
||||
luaL_argcheck(L, (size_t)startpos <= len, 3,
|
||||
"start position must be less than or equal to the input string length");
|
||||
|
||||
str += (size_t)startpos - 1;
|
||||
size_t offset = (size_t)startpos - 1 ;
|
||||
str += offset;
|
||||
len -= offset;
|
||||
|
||||
if (session->unpacker != LUA_REFNIL) {
|
||||
lmpack_geti(L, session->reg, session->unpacker);
|
||||
|
Loading…
Reference in New Issue
Block a user