diff options
author | Ingo Molnar <mingo@elte.hu> | 2009-12-16 18:33:49 +0100 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-12-16 18:33:49 +0100 |
commit | ee1156c11a1121e118b0a7f2dec240f0d421b1fd (patch) | |
tree | b8771cc5a9758af9d7410fc519227c036c222130 /fs/hfs/dir.c | |
parent | b9f8fcd55bbdb037e5332dbdb7b494f0b70861ac (diff) | |
parent | 8bea8672edfca7ec5f661cafb218f1205863b343 (diff) |
Merge branch 'linus' into sched/urgent
Conflicts:
kernel/sched_idletask.c
Merge reason: resolve the conflicts, pick up latest changes.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'fs/hfs/dir.c')
-rw-r--r-- | fs/hfs/dir.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/fs/hfs/dir.c b/fs/hfs/dir.c index 7c69b98a2e4..2b3b8611b41 100644 --- a/fs/hfs/dir.c +++ b/fs/hfs/dir.c @@ -79,6 +79,11 @@ static int hfs_readdir(struct file *filp, void *dirent, filldir_t filldir) filp->f_pos++; /* fall through */ case 1: + if (fd.entrylength > sizeof(entry) || fd.entrylength < 0) { + err = -EIO; + goto out; + } + hfs_bnode_read(fd.bnode, &entry, fd.entryoffset, fd.entrylength); if (entry.type != HFS_CDR_THD) { printk(KERN_ERR "hfs: bad catalog folder thread\n"); @@ -109,6 +114,12 @@ static int hfs_readdir(struct file *filp, void *dirent, filldir_t filldir) err = -EIO; goto out; } + + if (fd.entrylength > sizeof(entry) || fd.entrylength < 0) { + err = -EIO; + goto out; + } + hfs_bnode_read(fd.bnode, &entry, fd.entryoffset, fd.entrylength); type = entry.type; len = hfs_mac2asc(sb, strbuf, &fd.key->cat.CName); |