Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix use-after-free crash #49

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/ntfs2btrfs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -639,8 +639,8 @@ void root::create_trees(root& extent_root, enum btrfs_csum_type csum_type) {

auto in = (internal_node*)((uint8_t*)buf.data() + sizeof(tree_header));

for (const auto& t : trees) {
auto th2 = (tree_header*)t.data();
for (size_t i = 0; i < trees.size(); i++) {
auto th2 = (tree_header*)trees[i].data();

if (th2->level >= level)
break;
Expand Down Expand Up @@ -681,7 +681,7 @@ void root::create_trees(root& extent_root, enum btrfs_csum_type csum_type) {
trees_added++;
}

auto ln = (leaf_node*)((uint8_t*)t.data() + sizeof(tree_header));
auto ln = (leaf_node*)((uint8_t*)trees[i].data() + sizeof(tree_header));

in->key = ln->key;
in->address = th2->address;
Expand Down