https://git.reactos.org/?p=reactos.git;a=commitdiff;h=d256ff60068cafca0d3dc78f518b6617b786efe0
commit d256ff60068cafca0d3dc78f518b6617b786efe0 Author: Bartosz Brachaczek <[email protected]> AuthorDate: Mon Apr 1 02:09:23 2019 +0200 Commit: Pierre Schweitzer <[email protected]> CommitDate: Mon Apr 1 08:28:00 2019 +0200 [NTOSKRNL] Do not try to access OldBackTracking[-1] It can be triggered by the existing "F<", "FILE.TXT" case in the tests. CORE-15902 --- ntoskrnl/fsrtl/dbcsname.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ntoskrnl/fsrtl/dbcsname.c b/ntoskrnl/fsrtl/dbcsname.c index 3b1afd801e..362549e30b 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:
