mirror of
https://github.com/msgpack/msgpack-c.git
synced 2025-12-18 11:56:17 +01:00
Fixed #794.
Buffer is expanded not only Z_OK, but also Z_BUF_ERROR case.
This commit is contained in:
@@ -69,6 +69,7 @@ public:
|
||||
case Z_STREAM_END:
|
||||
return m_data;
|
||||
case Z_OK:
|
||||
case Z_BUF_ERROR:
|
||||
if(!expand()) {
|
||||
throw std::bad_alloc();
|
||||
}
|
||||
|
||||
@@ -146,6 +146,7 @@ static inline char* msgpack_zbuffer_flush(msgpack_zbuffer* zbuf)
|
||||
case Z_STREAM_END:
|
||||
return zbuf->data;
|
||||
case Z_OK:
|
||||
case Z_BUF_ERROR:
|
||||
if(!msgpack_zbuffer_expand(zbuf)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user