Skip to content

fix(joiner): add bounds checking on leaf reads#5524

Open
janos wants to merge 2 commits into
masterfrom
joiner-bounds-check
Open

fix(joiner): add bounds checking on leaf reads#5524
janos wants to merge 2 commits into
masterfrom
joiner-bounds-check

Conversation

@janos

@janos janos commented Jul 4, 2026

Copy link
Copy Markdown
Member

Checklist

  • I have read the coding guide.
  • My change requires a documentation update, and I have done it.
  • I have added tests to cover my changes.
  • I have filled out the description and linked the related issues.

Description

This PR fixes a panic (crash) and an infinite loop (hang/timeout) when reading malformed or corrupted trees in the joiner.

When the joiner processes a malformed tree where intermediate or root chunks advertise spans larger than the actual data present in their children it hangs in io.Copy as it always returns (0, nil), or panics when the data is requested by the look-ahead reader langos as the io.SeekEnd on joiner's Seek() reports longer data.

Tests are added for fix verification. The real world chunks and initial testing was provided by @acud, thanks.

Open API Spec Version Changes (if applicable)

Motivation and Context (Optional)

Related Issue (Optional)

Screenshots (if appropriate):

AI Disclosure

  • This PR contains code that has been generated by an LLM.
  • I have reviewed the AI generated code thoroughly.
  • I possess the technical expertise to responsibly review the code generated in this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants