From 414b4db8acc16a72c7e9a28a1bc558af3986a5c3 Mon Sep 17 00:00:00 2001 From: Aleksey Bragin Date: Tue, 9 Oct 2007 17:00:11 +0000 Subject: [PATCH] Mike Nordell - Add two checks for infinite loops. The latter gets triggered in some cases, a memory overwrite is suspected, or a race condition. svn path=/trunk/; revision=29471 --- reactos/ntoskrnl/cm/registry.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/reactos/ntoskrnl/cm/registry.c b/reactos/ntoskrnl/cm/registry.c index 6375f1417ce..5ef47f0c604 100644 --- a/reactos/ntoskrnl/cm/registry.c +++ b/reactos/ntoskrnl/cm/registry.c @@ -97,11 +97,21 @@ CmiWorkerThread(PVOID Param) !(CurrentKey->Flags & KO_MARKED_FOR_DELETE)) { ObDereferenceObject(CurrentKey); + if (CurrentEntry == CmiKeyObjectListHead.Blink) + { + DPRINT("Registry loop detected! Crashing\n"); + KEBUGCHECK(0); + } CurrentEntry = CmiKeyObjectListHead.Blink; Count++; } else { + if (CurrentEntry == CurrentEntry->Blink) + { + DPRINT("Registry loop detected! Crashing\n"); + KEBUGCHECK(0); + } CurrentEntry = CurrentEntry->Blink; } }