]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - fs/hfsplus/catalog.c
Merge branch 'fix/hda' into topic/hda
[karo-tx-linux.git] / fs / hfsplus / catalog.c
index ba117c445e78d8127e9835fd37a1bd50c07791f0..f6874acb2cf2a3a81a242f1983600eb912b9f607 100644 (file)
@@ -168,6 +168,11 @@ int hfsplus_find_cat(struct super_block *sb, u32 cnid,
                return -EIO;
        }
 
+       if (be16_to_cpu(tmp.thread.nodeName.length) > 255) {
+               printk(KERN_ERR "hfs: catalog name length corrupted\n");
+               return -EIO;
+       }
+
        hfsplus_cat_build_key_uni(fd->search_key, be32_to_cpu(tmp.thread.parentID),
                                 &tmp.thread.nodeName);
        return hfs_brec_find(fd);