Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: vsergeev/u-msgpack-python
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: vsergeev/u-msgpack-python
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: devel
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 2 commits
  • 2 files changed
  • 1 contributor

Commits on Jul 8, 2026

  1. catch RecursionError from deeply-nested input and raise MaximumDepthE…

    …xception
    
    Deserializing deeply-nested MessagePack arrays or maps recurses without
    bound and raises a bare RecursionError, which is not a subclass of the
    documented umsgpack.UnpackException. Untrusted input can therefore crash
    callers that only guard against UnpackException (a denial-of-service).
    
    Catch RecursionError at the top-level unpack entry points and re-raise it
    as MaximumDepthException, a new UnpackException subclass, so all unpacking
    failures remain within the documented exception hierarchy. Document the new
    exception in the unpack/unpackb docstrings.
    
    Signed-off-by: Vanya A. Sergeev <v@sergeev.io>
    
    Modifications:
    
    * Commit message subject line
    oc-8a8a9d authored and vsergeev committed Jul 8, 2026
    Configuration menu
    Copy the full SHA
    1b1ebfd View commit details
    Browse the repository at this point in the history
  2. add max_depth option for cap on nested container unpacking

    Introduce an opt-in max_depth option for unpack/unpackb. When set, nested
    array/map depth is tracked via a local argument threaded through a parallel
    depth-aware dispatch table and enforced with a decorator; exceeding the cap
    raises MaximumDepthException. When unset (the default), unpacking uses the
    original branch-free dispatch and container unpackers with no added cost;
    depth is never stored on the options dict.
    
    This lets callers bound recursion explicitly instead of relying on the
    interpreter's recursion limit, while keeping the default behavior and
    performance unchanged. Document the max_depth option in the unpack/unpackb
    docstrings.
    
    Signed-off-by: Vanya A. Sergeev <v@sergeev.io>
    
    Modifications:
    
    * Commit message subject line
    * Minor rewording of comments and docstrings
    oc-8a8a9d authored and vsergeev committed Jul 8, 2026
    Configuration menu
    Copy the full SHA
    ceab9e8 View commit details
    Browse the repository at this point in the history
Loading