Skip to content

Commit

Permalink
Solve undefined behavior in VMT hooker destructor
Browse files Browse the repository at this point in the history
  • Loading branch information
Northn committed Jun 4, 2021
1 parent 59af0a0 commit 23e26b5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/libs/rtdhook/rtdhook.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,10 @@ class rtdhook_vmt {
*/
~rtdhook_vmt()
{
for (auto& method : mHookedList)
for (auto ptr = mHookedList.begin(); ptr < mHookedList.end();)
{
uninstall(method.id);
rewrite_pointer(ptr->id, ptr->original);
ptr = mHookedList.erase(ptr);
}
}

Expand Down

0 comments on commit 23e26b5

Please sign in to comment.