From 06ec2bc1893c4911a37ad08c62e7c467abb69a34 Mon Sep 17 00:00:00 2001 From: Rafal Kupiec Date: Tue, 28 Jul 2026 18:22:03 +0200 Subject: [PATCH] Check if one wide string ended before the other --- xtoskrnl/rtl/widestr.cc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/xtoskrnl/rtl/widestr.cc b/xtoskrnl/rtl/widestr.cc index aed6c05..bd93528 100644 --- a/xtoskrnl/rtl/widestr.cc +++ b/xtoskrnl/rtl/widestr.cc @@ -124,6 +124,13 @@ RTL::WideString::CompareWideStringInsensitive(IN PCWSTR String1, Index++; } + /* Check if one wide string ended before the other */ + if((Length == 0 || Index < Length) && (String1[Index] != String2[Index])) + { + /* Wide strings are not equal */ + return String1[Index] > String2[Index] ? 1 : -1; + } + /* Strings are equal */ return 0; }