Merge pull request #22025 from neovim/backport-21899-to-release-0.8

[Backport release-0.8] fix(rpc): don't parse msgpack if buflen is 0
This commit is contained in:
zeertzjq
2023-01-28 08:00:09 +08:00
committed by GitHub

View File

@@ -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 */