From 01d127f49ee365c44fe70aaff8220a0f63bfbbdf Mon Sep 17 00:00:00 2001 From: Rafal Kupiec Date: Tue, 14 May 2024 15:53:21 +0200 Subject: [PATCH] Consider not initialized list as empty, what prevents page faults --- xtoskrnl/rtl/plist.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xtoskrnl/rtl/plist.c b/xtoskrnl/rtl/plist.c index 09f9f03..e63483c 100644 --- a/xtoskrnl/rtl/plist.c +++ b/xtoskrnl/rtl/plist.c @@ -94,7 +94,7 @@ RtlInsertTailList(IN OUT PLIST_ENTRY ListHead, } /** - * Indicates whether a doubly linked list structure is empty. + * Indicates whether a doubly linked list structure is empty, or not initialized at all. * * @param ListHead * Pointer to a structure that represents the head of the list. @@ -107,7 +107,7 @@ XTCDECL BOOLEAN RtlListEmpty(IN PLIST_ENTRY ListHead) { - return (ListHead->Flink == ListHead); + return (((ListHead->Flink == NULL) && (ListHead->Blink == NULL)) || (ListHead->Flink == ListHead)); } /**