Skip to content

fix(patch): hunk range overflow panic #83

Open
weihanglo wants to merge 2 commits intobmwill:masterfrom
weihanglo:overflow
Open

fix(patch): hunk range overflow panic #83
weihanglo wants to merge 2 commits intobmwill:masterfrom
weihanglo:overflow

Conversation

@weihanglo
Copy link
Copy Markdown
Contributor

This fix was chosen becuase it is the minimal one.

The other two call sites are not affected, as the comes from slices, where the length is bound by isize::MAX IIUC: https://doc.rust-lang.org/std/slice/fn.from_raw_parts.html#safety.

Alternatively we can return an Option from HunkRange::new.

See

This fix was chosen becuase it is the minimal one.

The other two call sites are not affected,
as the comes from slices,
where the length is bound by `isize::MAX` IIUC:
<https://doc.rust-lang.org/std/slice/fn.from_raw_parts.html#safety>.

Alternatively we can return an `Option` from `HunkRange`.
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.

1 participant