[FREELDR] Fix bug in Btrfs filename lookups. (#1951)
authorMark Harmstone <mark@harmstone.com>
Mon, 9 Sep 2019 18:39:58 +0000 (19:39 +0100)
committerHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Sat, 5 Oct 2019 21:20:51 +0000 (23:20 +0200)
boot/freeldr/freeldr/lib/fs/btrfs.c

index 2b88d6f..aa12d0e 100644 (file)
@@ -619,7 +619,7 @@ static BOOLEAN BtrFsLookupDirItemI(const struct btrfs_root_item *root, u64 dir_h
         name_buf = (char *) item + sizeof(*item);
         TRACE("Compare names %.*s and %.*s\n", name_len, name, item->name_len, name_buf);
 
-        if (_strnicmp(name, name_buf, name_len) == 0)
+        if (name_len == item->name_len && _strnicmp(name, name_buf, name_len) == 0)
         {
             *ret_item = *item;
             result = TRUE;