From: Bartosz Brachaczek Date: Mon, 1 Apr 2019 00:09:23 +0000 (+0200) Subject: [NTOSKRNL] Do not try to access OldBackTracking[-1] X-Git-Tag: 0.4.13-dev~96 X-Git-Url: https://git.reactos.org/?p=reactos.git;a=commitdiff_plain;h=d256ff60068cafca0d3dc78f518b6617b786efe0 [NTOSKRNL] Do not try to access OldBackTracking[-1] It can be triggered by the existing "F<", "FILE.TXT" case in the tests. CORE-15902 --- diff --git a/ntoskrnl/fsrtl/dbcsname.c b/ntoskrnl/fsrtl/dbcsname.c index 3b1afd801ec..362549e30b7 100644 --- a/ntoskrnl/fsrtl/dbcsname.c +++ b/ntoskrnl/fsrtl/dbcsname.c @@ -248,7 +248,7 @@ FsRtlIsDbcsInExpression(IN PANSI_STRING Expression, if (NamePosition >= Name->Length) { EndOfName = TRUE; - if (OldBackTracking[MatchingChars - 1] == Expression->Length * 2) + if (MatchingChars && OldBackTracking[MatchingChars - 1] == Expression->Length * 2) break; } else @@ -422,7 +422,7 @@ FsRtlIsDbcsInExpression(IN PANSI_STRING Expression, } /* Store result value */ - Result = (OldBackTracking[MatchingChars - 1] == Expression->Length * 2); + Result = MatchingChars && (OldBackTracking[MatchingChars - 1] == Expression->Length * 2); Exit: