GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — v5: plumbing: format/idxfile, Validate offset64 indices by hiddeco · Pull Request #2084 · go-git/go-git Conversation
Member
When a 32-bit offset entry has its MSB set, the lower 31 bits index into the Bounds-check the lookup against the decoded table size and return Backport of #2083.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactionsWhen a 32-bit offset entry has its MSB set, the lower 31 bits index into the `Offset64` table. `MemoryIndex.getOffset` did not validate that the resulting position fell inside the decoded table; an idx with an MSB-set entry whose lower bits exceed the number of decoded 64-bit entries would index past the end of the table. Bounds-check the lookup against the decoded table size and return `ErrMalformedIdxFile` when the index is out of range. The unexported `getOffset` now returns `(uint64, error)`; the change propagates through `FindOffset`, `genOffsetHash`, and the `Entries` iterator. Backport of go-git#2083. Assisted-by: Claude Opus 4.7 Signed-off-by: Hidde Beydals <[email protected]> The previous bounds check `offset+8 > uint64(len(idx.Offset64))` was correct because masking and the `uint32` source type bound `offset` to ~2^34, leaving uint64 headroom. That safety relies on invariants in surrounding code (mask shape and source type) that aren't visible at the comparison itself. Reformulate as `len < 8 || offset > len-8`, which holds without relying on the upstream bound. Behaviour is unchanged. Backport of go-git#2083. Assisted-by: Claude Opus 4.7 <[email protected]> Signed-off-by: Hidde Beydals <[email protected]>
hiddeco
force-pushed
the
v5/idxfile-validate-offset64
branch
from
4e12b9b to
15b0338
Compare
pjbgf
approved these changes
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @hiddeco thanks for working on this. 🙇
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactionsUh oh!
There was an error while loading. Please reload this page.
Maks1mS
pushed a commit
to stplr-dev/stplr
that referenced
this pull request
This PR contains the following updates: | Package | Type | Update | Change | OpenSSF | |---|---|---|---|---| | [github.com/go-git/go-git/v5](https://github.com/go-git/go-git) | require | patch | `v5.19.0` → `v5.19.1` | [](https://securityscorecards.dev/viewer/?uri=github.com/go-git/go-git) | --- >
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ReviewersUh oh!
There was an error while loading. Please reload this page. AssigneesNo one assignedLabels
None yet
ProjectsMilestoneNo milestoneDevelopmentSuccessfully merging this pull request may close these issues. Uh oh!
There was an error while loading. Please reload this page. Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later. |
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |