mirror of
https://github.com/msgpack/msgpack-c.git
synced 2025-03-19 21:18:23 +01:00
fix msgpack_unpacker_expand_buffer
This commit is contained in:
parent
0efb8160b9
commit
cb24a0c24f
@ -283,6 +283,8 @@ bool msgpack_unpacker_expand_buffer(msgpack_unpacker* mpac, size_t size)
|
||||
|
||||
init_count(tmp);
|
||||
|
||||
memcpy(tmp+COUNTER_SIZE, mpac->buffer+mpac->off, not_parsed);
|
||||
|
||||
if(CTX_REFERENCED(mpac)) {
|
||||
if(!msgpack_zone_push_finalizer(mpac->z, decl_count, mpac->buffer)) {
|
||||
free(tmp);
|
||||
@ -293,8 +295,6 @@ bool msgpack_unpacker_expand_buffer(msgpack_unpacker* mpac, size_t size)
|
||||
decl_count(mpac->buffer);
|
||||
}
|
||||
|
||||
memcpy(tmp+COUNTER_SIZE, mpac->buffer+mpac->off, not_parsed);
|
||||
|
||||
mpac->buffer = tmp;
|
||||
mpac->used = not_parsed + COUNTER_SIZE;
|
||||
mpac->free = next_size - mpac->used;
|
||||
|
Loading…
x
Reference in New Issue
Block a user