提交 7237aecd 编写于 作者: F Fam Zheng 提交者: Kevin Wolf

vmdk: Widen before shifting 32 bit header field

Coverity spotted this.

The field is 32 bits, but if it's possible to overflow in 32 bit
left shift.
Signed-off-by: NFam Zheng <famz@redhat.com>
Reviewed-by: NJohn Snow <jsnow@redhat.com>
Signed-off-by: NKevin Wolf <kwolf@redhat.com>
上级 5505e8b7
...@@ -523,7 +523,7 @@ static int vmdk_open_vmfs_sparse(BlockDriverState *bs, ...@@ -523,7 +523,7 @@ static int vmdk_open_vmfs_sparse(BlockDriverState *bs,
} }
ret = vmdk_add_extent(bs, file, false, ret = vmdk_add_extent(bs, file, false,
le32_to_cpu(header.disk_sectors), le32_to_cpu(header.disk_sectors),
le32_to_cpu(header.l1dir_offset) << 9, (int64_t)le32_to_cpu(header.l1dir_offset) << 9,
0, 0,
le32_to_cpu(header.l1dir_size), le32_to_cpu(header.l1dir_size),
4096, 4096,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册