diff options
Diffstat (limited to 'src/mpack/mpack_core.c')
-rw-r--r-- | src/mpack/mpack_core.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/mpack/mpack_core.c b/src/mpack/mpack_core.c index 4ee67a032a..3424f444b9 100644 --- a/src/mpack/mpack_core.c +++ b/src/mpack/mpack_core.c @@ -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 */ |