mirror of
https://github.com/msgpack/msgpack-c.git
synced 2025-10-19 12:42:31 +02:00
Fixed #348.
The parameter 'offset' of unpack() function family, not unpacker family, updates only when the function successfully finished. The parameter 'offset' used to update even if a caller passes insufficient bytes to the unpack() function family.
This commit is contained in:
@@ -618,12 +618,13 @@ msgpack_unpack_next(msgpack_unpacked* result,
|
||||
return MSGPACK_UNPACK_PARSE_ERROR;
|
||||
}
|
||||
|
||||
if(off != NULL) { *off = noff; }
|
||||
|
||||
if(e == 0) {
|
||||
return MSGPACK_UNPACK_CONTINUE;
|
||||
}
|
||||
|
||||
if(off != NULL) { *off = noff; }
|
||||
|
||||
result->data = template_data(&ctx);
|
||||
|
||||
return MSGPACK_UNPACK_SUCCESS;
|
||||
|
Reference in New Issue
Block a user