Skip to content

Commit d6f53fc

Browse files
committed
unhookFunction - Make sure the trampoline isn't a nullptr
1 parent 6b6a049 commit d6f53fc

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

ttyd-tools/rel/include/patch.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,11 @@ Func hookFunction(Func function, Dest destination)
5656
template<typename Func>
5757
Func unhookFunction(Func trampoline)
5858
{
59+
if (!trampoline)
60+
{
61+
return nullptr;
62+
}
63+
5964
uint32_t *instructions = reinterpret_cast<uint32_t *>(trampoline);
6065

6166
// Restore the original instruction

0 commit comments

Comments
 (0)