提交 5c80f5aa 编写于 作者: P Phillip Lougher

squashfs: fix name reading in squashfs_xattr_get

Only read potentially matching names into the target buffer, all
obviously non matching names don't need to be read into the
target buffer.
Signed-off-by: NPhillip Lougher <phillip@lougher.demon.co.uk>
上级 f6db25a8
......@@ -145,8 +145,12 @@ static int squashfs_xattr_get(struct inode *inode, int name_index,
type = le16_to_cpu(entry.type);
prefix = type & SQUASHFS_XATTR_PREFIX_MASK;
err = squashfs_read_metadata(sb, target, &start, &offset,
name_size);
if (prefix == name_index && name_size == name_len)
err = squashfs_read_metadata(sb, target, &start,
&offset, name_size);
else
err = squashfs_read_metadata(sb, NULL, &start,
&offset, name_size);
if (err < 0)
goto failed;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册