isofs: avoid info leak on export
[pandora-kernel.git] / fs / isofs / export.c
index dd4687f..fd88add 100644 (file)
@@ -135,6 +135,7 @@ isofs_export_encode_fh(struct dentry *dentry,
        len = 3;
        fh32[0] = ei->i_iget5_block;
        fh16[2] = (__u16)ei->i_iget5_offset;  /* fh16 [sic] */
+       fh16[3] = 0;  /* avoid leaking uninitialized data */
        fh32[2] = inode->i_generation;
        if (connectable && !S_ISDIR(inode->i_mode)) {
                struct inode *parent;
@@ -179,7 +180,7 @@ static struct dentry *isofs_fh_to_parent(struct super_block *sb,
 {
        struct isofs_fid *ifid = (struct isofs_fid *)fid;
 
-       if (fh_type != 2)
+       if (fh_len < 2 || fh_type != 2)
                return NULL;
 
        return isofs_export_iget(sb,