Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Fixed mem write for empty slice #5825

Merged
merged 1 commit into from
Jun 12, 2017
Merged

Fixed mem write for empty slice #5825

merged 1 commit into from
Jun 12, 2017

Conversation

arkpar
Copy link
Collaborator

@arkpar arkpar commented Jun 12, 2017

Also removed side_effects field that is not used anywhere

@arkpar arkpar added A0-pleasereview 🤓 Pull request needs code review. M4-core ⛓ Core client code / Rust. labels Jun 12, 2017
self[off..off+slice.len()].copy_from_slice(slice);
if !slice.is_empty() {
let off = offset.low_u64() as usize;
self[off..off+slice.len()].copy_from_slice(slice);
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apparently copy_from_slice checks for bounds even if slice is empty.

@arkpar arkpar merged commit 6b874ce into master Jun 12, 2017
arkpar added a commit that referenced this pull request Jun 12, 2017
arkpar added a commit that referenced this pull request Jun 12, 2017
@arkpar
Copy link
Collaborator Author

arkpar commented Jun 12, 2017

Merged by mistake. Reverted.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A0-pleasereview 🤓 Pull request needs code review. M4-core ⛓ Core client code / Rust.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant