From 3a58832c043c59465f99b06fe9dbfe3b14fa3e32 Mon Sep 17 00:00:00 2001 From: Stefan Ginsberg Date: Sun, 11 Oct 2009 21:57:52 +0000 Subject: [PATCH] - Fix a critical bug in KeFindConfigurationEntry; it passed NULL to KeFindConfigurationNextEntry instead of passing a pointer containing NULL. KeFindConfigurationNextEntry dereferenced this and, because the old bootloader maps NULL, read some bogus value. KeFindConfigurationNextEntry would then try to find something in the configuration tree that matched this, but failed. This was no problem because we currently have no callers of those routines in ReactOS. However, the kdcom.dll from Windows 2003 calls KeFindConfigurationEntry to find COM port entries, and this would have crashed if FreeLdr hadn't mapped it. As it is, it didn't, and kdcom fell back to default values for the COM port (which worked). WinLdr doesn't map NULL and this resulted in a crash during kdcom initialization. Bug introduced in revision 15911 over 4 years ago. KD64 now works when booting with the new boot method. svn path=/trunk/; revision=43382 --- reactos/ntoskrnl/ke/config.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/reactos/ntoskrnl/ke/config.c b/reactos/ntoskrnl/ke/config.c index aa92e96ea67..5f9a196d032 100644 --- a/reactos/ntoskrnl/ke/config.c +++ b/reactos/ntoskrnl/ke/config.c @@ -24,12 +24,14 @@ KeFindConfigurationEntry(IN PCONFIGURATION_COMPONENT_DATA Child, IN CONFIGURATION_TYPE Type, IN PULONG ComponentKey OPTIONAL) { + PCONFIGURATION_COMPONENT_DATA NextLink = NULL; + /* Start Search at Root */ return KeFindConfigurationNextEntry(Child, Class, Type, ComponentKey, - NULL); + &NextLink); } /*