]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/hfsplus/catalog.c
Merge branch 'linus' into core/urgent
[linux-2.6-omap-h63xx.git] / fs / hfsplus / catalog.c
index f2d7c49ce7595d16ed12e3ae834dbe6e93b54c6d..f6874acb2cf2a3a81a242f1983600eb912b9f607 100644 (file)
@@ -8,7 +8,6 @@
  * Handling of catalog records
  */
 
-#include <linux/sched.h>
 
 #include "hfsplus_fs.h"
 #include "hfsplus_raw.h"
@@ -169,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);