Visitar URL original
Comparing master@{1day}...master · msgpack/msgpack-ruby · GitHub
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: msgpack/msgpack-ruby
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master@{1day}
Choose a base ref
...
head repository: msgpack/msgpack-ruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
  • 6 commits
  • 4 files changed
  • 3 contributors

Commits on Oct 11, 2026

  1. Speed up decoding of oversized integers

    Bigint.from_msgpack_ext rebuilt the integer by shifting and adding one
    32-bit chunk at a time. Each step copies the whole growing bignum, so
    decoding was quadratic in the payload length (a 1 MiB ext payload took
    over 20 seconds). Convert the chunks to a hex string and parse it in a
    single String#to_i(16), which runs in linear time.
    
    Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
    Watson1978 and claude committed Oct 11, 2026
    Configuration menu
    Copy the full SHA
    6bf285b View commit details
    Browse the repository at this point in the history
  2. Fix excessive memory allocation from crafted container headers

    A container header carries an element count that the unpacker used to
    pre-allocate the Array or Hash. The count is capped at SHRT_MAX per
    container, but nested containers each pre-allocate up to that cap, so a
    small crafted message of deeply nested headers could still force a large
    allocation, and a streaming Unpacker holds it until the connection ends.
    
    An element needs at least one byte, so a container cannot hold more
    elements than there are bytes left to read. Cap the initial size by the
    buffered size as well; the container still grows as more data arrives.
    
    Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
    Watson1978 and claude committed Oct 11, 2026
    Configuration menu
    Copy the full SHA
    c8d42d8 View commit details
    Browse the repository at this point in the history
  3. Merge pull request #409 from Watson1978/fix/unpacker-container-prealloc

    Fix excessive memory allocation from crafted container headers
    byroot authored Oct 11, 2026
    Configuration menu
    Copy the full SHA
    1a9f0e3 View commit details
    Browse the repository at this point in the history
  4. Merge pull request #408 from Watson1978/speedup/bigint-decode

    Speed up decoding of oversized integers
    byroot authored Oct 11, 2026
    Configuration menu
    Copy the full SHA
    314d65d View commit details
    Browse the repository at this point in the history
  5. Fix use-after-free when packing a string into an IO

    msgpack_buffer_append_string read the string's raw pointer up front and
    then grew the buffer. Growing it runs io.write (arbitrary Ruby) and can
    trigger GC, either of which may free or shrink the string's backing
    memory, so the later memcpy could read freed memory and copy heap
    contents into the output. Reserve the space first and read the pointer
    only afterwards, clamping and zero-filling if the string shrank in the
    meantime so the copy stays within the current buffer.
    
    Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
    Watson1978 and claude committed Oct 11, 2026
    Configuration menu
    Copy the full SHA
    8731b86 View commit details
    Browse the repository at this point in the history
  6. Merge pull request #410 from Watson1978/fix/buffer-append-string-uaf

    Fix use-after-free when packing a string into an IO
    byroot authored Oct 11, 2026
    Configuration menu
    Copy the full SHA
    e89b5bc View commit details
    Browse the repository at this point in the history
Loading