From ef6bc56d6f7ee358d4750e7ac6573e42a68f1fe7 Mon Sep 17 00:00:00 2001 From: Sir Richard Date: Tue, 19 Oct 2010 17:39:22 +0000 Subject: [PATCH] [NTOS]: C Pointer Math will bite even the most experienced programmer in the ass. Fix wrong calculation which led to ASSERTs and memory corruption (since the last revision). svn path=/trunk/; revision=49208 --- reactos/ntoskrnl/mm/ARM3/miarm.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reactos/ntoskrnl/mm/ARM3/miarm.h b/reactos/ntoskrnl/mm/ARM3/miarm.h index 09f2ae1ab15..22a06ed18b7 100644 --- a/reactos/ntoskrnl/mm/ARM3/miarm.h +++ b/reactos/ntoskrnl/mm/ARM3/miarm.h @@ -843,7 +843,7 @@ MI_GET_PROTOTYPE_PTE_FOR_VPN(IN PMMVAD Vad, PMMPTE ProtoPte; /* Find the offset within the VAD's prototype PTEs */ - ProtoPte = Vad->FirstPrototypePte + ((Vpn - Vad->StartingVpn) * sizeof(MMPTE)); + ProtoPte = Vad->FirstPrototypePte + (Vpn - Vad->StartingVpn); ASSERT(ProtoPte <= Vad->LastContiguousPte); return ProtoPte; }