[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 72/76] vmdk: Widen before shifting 32 bit header fiel
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PULL 72/76] vmdk: Widen before shifting 32 bit header field |
Date: |
Tue, 28 Apr 2015 17:00:54 +0200 |
From: Fam Zheng <address@hidden>
Coverity spotted this.
The field is 32 bits, but if it's possible to overflow in 32 bit
left shift.
Signed-off-by: Fam Zheng <address@hidden>
Reviewed-by: John Snow <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
block/vmdk.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/block/vmdk.c b/block/vmdk.c
index fd94b8f..1c5e2ef 100644
--- a/block/vmdk.c
+++ b/block/vmdk.c
@@ -523,7 +523,7 @@ static int vmdk_open_vmfs_sparse(BlockDriverState *bs,
}
ret = vmdk_add_extent(bs, file, false,
le32_to_cpu(header.disk_sectors),
- le32_to_cpu(header.l1dir_offset) << 9,
+ (int64_t)le32_to_cpu(header.l1dir_offset) << 9,
0,
le32_to_cpu(header.l1dir_size),
4096,
--
1.8.3.1
- [Qemu-devel] [PULL 62/76] block: Ensure consistent bitmap function prototypes, (continued)
- [Qemu-devel] [PULL 62/76] block: Ensure consistent bitmap function prototypes, Kevin Wolf, 2015/04/28
- [Qemu-devel] [PULL 63/76] block: Resize bitmaps on bdrv_truncate, Kevin Wolf, 2015/04/28
- [Qemu-devel] [PULL 64/76] hbitmap: truncate tests, Kevin Wolf, 2015/04/28
- [Qemu-devel] [PULL 65/76] iotests: add invalid input incremental backup tests, Kevin Wolf, 2015/04/28
- [Qemu-devel] [PULL 68/76] iotests: add incremental backup failure recovery test, Kevin Wolf, 2015/04/28
- [Qemu-devel] [PULL 69/76] iotests: add incremental backup granularity tests, Kevin Wolf, 2015/04/28
- [Qemu-devel] [PULL 71/76] block/dmg: make it modular, Kevin Wolf, 2015/04/28
- [Qemu-devel] [PULL 70/76] block/mirror: Always call block_job_sleep_ns(), Kevin Wolf, 2015/04/28
- [Qemu-devel] [PULL 73/76] block: replace bdrv_states iteration with bdrv_next(), Kevin Wolf, 2015/04/28
- [Qemu-devel] [PULL 67/76] iotests: add simple incremental backup case, Kevin Wolf, 2015/04/28
- [Qemu-devel] [PULL 72/76] vmdk: Widen before shifting 32 bit header field,
Kevin Wolf <=
- [Qemu-devel] [PULL 74/76] block: add bdrv_set_dirty()/bdrv_reset_dirty() to block_int.h, Kevin Wolf, 2015/04/28
- [Qemu-devel] [PULL 75/76] block: extract bdrv_setup_io_funcs(), Kevin Wolf, 2015/04/28
- [Qemu-devel] [PULL 76/76] block: move I/O request processing to block/io.c, Kevin Wolf, 2015/04/28
- [Qemu-devel] [PULL 66/76] iotests: add QMP event waiting queue, Kevin Wolf, 2015/04/28
- Re: [Qemu-devel] [PULL 00/76] Block patches, Peter Maydell, 2015/04/28