Skip to content

Commit 6954e01

Browse files
committed
Fixed #794.
Buffer is expanded not only Z_OK, but also Z_BUF_ERROR case.
1 parent 7e23ec4 commit 6954e01

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

include/msgpack/v1/zbuffer.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ class zbuffer {
6969
case Z_STREAM_END:
7070
return m_data;
7171
case Z_OK:
72+
case Z_BUF_ERROR:
7273
if(!expand()) {
7374
throw std::bad_alloc();
7475
}

include/msgpack/zbuffer.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ static inline char* msgpack_zbuffer_flush(msgpack_zbuffer* zbuf)
146146
case Z_STREAM_END:
147147
return zbuf->data;
148148
case Z_OK:
149+
case Z_BUF_ERROR:
149150
if(!msgpack_zbuffer_expand(zbuf)) {
150151
return NULL;
151152
}

0 commit comments

Comments
 (0)