summaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
authorShawn Hoffman <godisgovernment@gmail.com>2020-08-16 15:08:22 -0700
committerShawn Hoffman <godisgovernment@gmail.com>2020-08-16 15:17:11 -0700
commit9a5a705d0111ac7546bef4e06bb86d9dd66d379b (patch)
tree39831f37612c826349f970bce4877c4ed8432f5b /Source
parent9d880c2db3ef20de2932a92d1d4c4be0dc772299 (diff)
Fix comparison to invalidated vector iterator.
GetFstEntryForPath may modify the children vector, so do it before taking an iterator to the vector.
Diffstat (limited to 'Source')
-rw-r--r--Source/Core/Core/IOS/FS/HostBackend/FS.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Source/Core/Core/IOS/FS/HostBackend/FS.cpp b/Source/Core/Core/IOS/FS/HostBackend/FS.cpp
index 8859be7474..306cbb347b 100644
--- a/Source/Core/Core/IOS/FS/HostBackend/FS.cpp
+++ b/Source/Core/Core/IOS/FS/HostBackend/FS.cpp
@@ -515,9 +515,9 @@ ResultCode HostFileSystem::Rename(Uid uid, Gid gid, const std::string& old_path,
}
// Finally, remove the child from the old parent and move it to the new parent.
+ FstEntry* new_entry = GetFstEntryForPath(new_path);
const auto it = std::find_if(old_parent->children.begin(), old_parent->children.end(),
GetNamePredicate(split_old_path.file_name));
- FstEntry* new_entry = GetFstEntryForPath(new_path);
if (it != old_parent->children.end())
{
*new_entry = *it;