From f456cfd21e6e9d4a778600c89c2d3d085dc3e859 Mon Sep 17 00:00:00 2001 From: Rafal Kupiec Date: Wed, 29 Jul 2026 16:52:57 +0200 Subject: [PATCH] Check if one string ended before the other --- xtoskrnl/rtl/string.cc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/xtoskrnl/rtl/string.cc b/xtoskrnl/rtl/string.cc index 05f2dfc57..5fbf46792 100644 --- a/xtoskrnl/rtl/string.cc +++ b/xtoskrnl/rtl/string.cc @@ -124,6 +124,13 @@ RTL::String::CompareStringInsensitive(IN PCSTR String1, Index++; } + /* Check if one string ended before the other */ + if((Length == 0 || Index < Length) && (String1[Index] != String2[Index])) + { + /* Strings are not equal */ + return String1[Index] > String2[Index] ? 1 : -1; + } + /* Strings are equal */ return 0; }