[NTOSKRNL] Do not try to access OldBackTracking[-1]
[reactos.git] / ntoskrnl / fsrtl / dbcsname.c
index 3b1afd8..362549e 100644 (file)
@@ -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: