]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/hfs/catalog.c
ide: Add tx4939ide driver (v6)
[linux-2.6-omap-h63xx.git] / fs / hfs / catalog.c
index 2fcd679f02383366b7f8774ef2ed00d9fe924727..6d98f116ca03d610a1477dc77558c899f5abe48d 100644 (file)
@@ -184,12 +184,16 @@ int hfs_cat_find_brec(struct super_block *sb, u32 cnid,
 
        type = rec.type;
        if (type != HFS_CDR_THD && type != HFS_CDR_FTH) {
-               printk("HFS-fs: Found bad thread record in catalog\n");
+               printk(KERN_ERR "hfs: found bad thread record in catalog\n");
                return -EIO;
        }
 
        fd->search_key->cat.ParID = rec.thread.ParID;
        len = fd->search_key->cat.CName.len = rec.thread.CName.len;
+       if (len > HFS_NAMELEN) {
+               printk(KERN_ERR "hfs: bad catalog namelength\n");
+               return -EIO;
+       }
        memcpy(fd->search_key->cat.CName.name, rec.thread.CName.name, len);
        return hfs_brec_find(fd);
 }