Btrfs: align offsets for btrfs_ordered_update_i_size
[safe/jmp/linux-2.6] / fs / isofs / dir.c
index 1ba407c..8ba5441 100644 (file)
@@ -145,6 +145,14 @@ static int do_isofs_readdir(struct inode *inode, struct file *filp,
                        }
                        de = tmpde;
                }
+               /* Basic sanity check, whether name doesn't exceed dir entry */
+               if (de_len < de->name_len[0] +
+                                       sizeof(struct iso_directory_record)) {
+                       printk(KERN_NOTICE "iso9660: Corrupted directory entry"
+                              " in block %lu of inode %lu\n", block,
+                              inode->i_ino);
+                       return -EIO;
+               }
 
                if (first_de) {
                        isofs_normalize_block_and_offset(de,
@@ -187,9 +195,8 @@ static int do_isofs_readdir(struct inode *inode, struct file *filp,
                 * Do not report hidden files if so instructed, or associated
                 * files unless instructed to do so
                 */
-               if ((sbi->s_hide == 'y' &&
-                               (de->flags[-sbi->s_high_sierra] & 1)) ||
-                               (sbi->s_showassoc =='n' &&
+               if ((sbi->s_hide && (de->flags[-sbi->s_high_sierra] & 1)) ||
+                   (!sbi->s_showassoc &&
                                (de->flags[-sbi->s_high_sierra] & 4))) {
                        filp->f_pos += de_len;
                        continue;