diff options
-rw-r--r-- | fs/hfsplus/catalog.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/hfsplus/catalog.c b/fs/hfsplus/catalog.c index ba117c445e78..f6874acb2cf2 100644 --- a/fs/hfsplus/catalog.c +++ b/fs/hfsplus/catalog.c | |||
@@ -168,6 +168,11 @@ int hfsplus_find_cat(struct super_block *sb, u32 cnid, | |||
168 | return -EIO; | 168 | return -EIO; |
169 | } | 169 | } |
170 | 170 | ||
171 | if (be16_to_cpu(tmp.thread.nodeName.length) > 255) { | ||
172 | printk(KERN_ERR "hfs: catalog name length corrupted\n"); | ||
173 | return -EIO; | ||
174 | } | ||
175 | |||
171 | hfsplus_cat_build_key_uni(fd->search_key, be32_to_cpu(tmp.thread.parentID), | 176 | hfsplus_cat_build_key_uni(fd->search_key, be32_to_cpu(tmp.thread.parentID), |
172 | &tmp.thread.nodeName); | 177 | &tmp.thread.nodeName); |
173 | return hfs_brec_find(fd); | 178 | return hfs_brec_find(fd); |