|
@@ -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);
|