mirror of
https://github.com/neovim/neovim.git
synced 2025-09-05 19:08:15 +00: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:
@@ -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);
|
||||
|
Reference in New Issue
Block a user