mirror of
https://github.com/msgpack/msgpack-python.git
synced 2026-06-18 21:52:06 +00:00
fix: check unpack_callback_uint32 result (#666)
Similar to #665, just a return value check to propagate the error in case one happens (instead of silently ignoring it). Note that as opposed to the previous lines, we don't need to `PyErr_SetString` since `unpack_callback_uint32` calls `PyLong_FromSize_t` which itself should set whatever Python error is relevant; we just need to make it clear to the caller that an error occurred.
This commit is contained in:
parent
6357bc272c
commit
156bb05a15
1 changed files with 4 additions and 1 deletions
|
|
@ -45,7 +45,10 @@ static inline int unpack_container_header(unpack_context* ctx, const char* data,
|
|||
PyErr_SetString(PyExc_ValueError, "Unexpected type header on stream");
|
||||
return -1;
|
||||
}
|
||||
unpack_callback_uint32(&ctx->user, size, &ctx->stack[0].obj);
|
||||
|
||||
if (unpack_callback_uint32(&ctx->user, size, &ctx->stack[0].obj) < 0)
|
||||
return -1;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue