Skip to content

Commit 5e27906

Browse files
authored
Fix: Correct sizeof usage in DetourTransactionCommitEx (microsoft#331)
Replaced `sizeof(o->pTrampoline)` with `sizeof(*o->pTrampoline)` to correctly calculate the trampoline size when adjusting thread instruction pointers.
1 parent dff7343 commit 5e27906

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/detours.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1950,7 +1950,7 @@ typedef ULONG_PTR DETOURS_EIP_TYPE;
19501950
if (o->fIsRemove) {
19511951
if (cxt.DETOURS_EIP >= (DETOURS_EIP_TYPE)(ULONG_PTR)o->pTrampoline &&
19521952
cxt.DETOURS_EIP < (DETOURS_EIP_TYPE)((ULONG_PTR)o->pTrampoline
1953-
+ sizeof(o->pTrampoline))
1953+
+ sizeof(*o->pTrampoline))
19541954
) {
19551955

19561956
cxt.DETOURS_EIP = (DETOURS_EIP_TYPE)

0 commit comments

Comments
 (0)