mirror of
https://github.com/neovim/neovim.git
synced 2024-09-17 20:58:20 -04:00
fix(rpc): don't parse msgpack if buflen is 0 (#21899)
This prevents `buflen` from becoming a very large number when it is 0 when calling mpack_rtoken().
This commit is contained in:
parent
363d153bb9
commit
adfad50ac0
@ -173,6 +173,9 @@ MPACK_API int mpack_write(mpack_tokbuf_t *tokbuf, char **buf, size_t *buflen,
|
||||
|
||||
int mpack_rtoken(const char **buf, size_t *buflen, mpack_token_t *tok)
|
||||
{
|
||||
if (*buflen == 0) {
|
||||
return MPACK_EOF;
|
||||
}
|
||||
unsigned char t = ADVANCE(buf, buflen);
|
||||
if (t < 0x80) {
|
||||
/* positive fixint */
|
||||
|
Loading…
Reference in New Issue
Block a user