| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
Unpacker.skip() does not build the objects on the parser stack. So stack[].obj stays uninitialized after an incomplete skip(). A later Unpacker.unpack() writes an array item through that pointer and the process crashes. The reverse order drops the reference that the construct pass took. Record the mode that started the object in unpack_context. unpack_construct() and unpack_skip() now raise ValueError on a change. The parser state stays intact, so the original mode still finishes the object.
There was a problem hiding this comment.
The guard preserves parser state and the tests cover both unsafe mode-switch directions.
Pull request overviewPrevents unsafe switching between Unpacker.unpack() and skip() while parsing an incomplete container.
Changes:
| File | Description |
|---|---|
| msgpack/unpack_template.h | Adds mode tracking and validation. |
| test/test_sequnpack.py | Tests rejected mode switches and subsequent completion. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
#734