diff options
Diffstat (limited to 'fs/isofs/namei.c')
-rw-r--r-- | fs/isofs/namei.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/isofs/namei.c b/fs/isofs/namei.c index 344b247bc29a..8299889a835e 100644 --- a/fs/isofs/namei.c +++ b/fs/isofs/namei.c @@ -111,6 +111,13 @@ isofs_find_entry(struct inode *dir, struct dentry *dentry, dlen = de->name_len[0]; dpnt = de->name; + /* Basic sanity check, whether name doesn't exceed dir entry */ + if (de_len < dlen + sizeof(struct iso_directory_record)) { + printk(KERN_NOTICE "iso9660: Corrupted directory entry" + " in block %lu of inode %lu\n", block, + dir->i_ino); + return 0; + } if (sbi->s_rock && ((i = get_rock_ridge_filename(de, tmpname, dir)))) { |