mirror of
https://github.com/msgpack/msgpack-python.git
synced 2026-02-07 02:09:59 +00:00
fix msgpack_unpacker_expand_buffer
This commit is contained in:
parent
b33ecbd92b
commit
87724d5b51
1 changed files with 2 additions and 2 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue