]> git.sesse.net Git - bcachefs-tools-debian/blobdiff - libbcachefs/fsck.c
Update bcachefs sources to 4b5917839c bcachefs: Fix a null ptr deref in check_xattr()
[bcachefs-tools-debian] / libbcachefs / fsck.c
index 37ba927cbd31e6c571dd3fd197ea1e8ece5067c1..c07ddfa0001dac41026f782c8432c5ad5263a667 100644 (file)
@@ -1669,7 +1669,7 @@ static int check_dirent(struct btree_trans *trans, struct btree_iter *iter,
        if (ret < 0)
                goto err;
 
-       if (dir->first_this_inode)
+       if (dir->first_this_inode && dir->inodes.nr)
                *hash_info = bch2_hash_info_init(c, &dir->inodes.data[0].inode);
        dir->first_this_inode = false;
 
@@ -1846,7 +1846,7 @@ static int check_xattr(struct btree_trans *trans, struct btree_iter *iter,
        if (ret)
                return ret;
 
-       if (inode->first_this_inode)
+       if (inode->first_this_inode && inode->inodes.nr)
                *hash_info = bch2_hash_info_init(c, &inode->inodes.data[0].inode);
        inode->first_this_inode = false;