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