aboutsummaryrefslogtreecommitdiffstats
path: root/fs/hfs/super.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/hfs/super.c')
-rw-r--r--fs/hfs/super.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/fs/hfs/super.c b/fs/hfs/super.c
index f7fcbe49da72..0a81eb7111f3 100644
--- a/fs/hfs/super.c
+++ b/fs/hfs/super.c
@@ -19,6 +19,7 @@
19#include <linux/nls.h> 19#include <linux/nls.h>
20#include <linux/parser.h> 20#include <linux/parser.h>
21#include <linux/seq_file.h> 21#include <linux/seq_file.h>
22#include <linux/slab.h>
22#include <linux/smp_lock.h> 23#include <linux/smp_lock.h>
23#include <linux/vfs.h> 24#include <linux/vfs.h>
24 25
@@ -409,8 +410,13 @@ static int hfs_fill_super(struct super_block *sb, void *data, int silent)
409 /* try to get the root inode */ 410 /* try to get the root inode */
410 hfs_find_init(HFS_SB(sb)->cat_tree, &fd); 411 hfs_find_init(HFS_SB(sb)->cat_tree, &fd);
411 res = hfs_cat_find_brec(sb, HFS_ROOT_CNID, &fd); 412 res = hfs_cat_find_brec(sb, HFS_ROOT_CNID, &fd);
412 if (!res) 413 if (!res) {
414 if (fd.entrylength > sizeof(rec) || fd.entrylength < 0) {
415 res = -EIO;
416 goto bail;
417 }
413 hfs_bnode_read(fd.bnode, &rec, fd.entryoffset, fd.entrylength); 418 hfs_bnode_read(fd.bnode, &rec, fd.entryoffset, fd.entrylength);
419 }
414 if (res) { 420 if (res) {
415 hfs_find_exit(&fd); 421 hfs_find_exit(&fd);
416 goto bail_no_root; 422 goto bail_no_root;