mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2024-11-13 23:46:40 +00:00
Fix additional UAF in DirEntry building
This commit is contained in:
parent
a46e796f4d
commit
eaa282b915
1 changed files with 5 additions and 0 deletions
|
@ -352,6 +352,11 @@ void RomFSBuildContext::Build(std::vector<RomFSSourceInfo> *out_infos) {
|
||||||
memset(cur_entry->name, 0, (cur_entry->name_size + 3) & ~3);
|
memset(cur_entry->name, 0, (cur_entry->name_size + 3) & ~3);
|
||||||
memcpy(cur_entry->name, cur_dir->path + cur_dir->cur_path_ofs, name_size);
|
memcpy(cur_entry->name, cur_dir->path + cur_dir->cur_path_ofs, name_size);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Delete directories. */
|
||||||
|
for (const auto &it : this->directories) {
|
||||||
|
cur_dir = it.second;
|
||||||
delete cur_dir->path;
|
delete cur_dir->path;
|
||||||
delete cur_dir;
|
delete cur_dir;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue