Hu Tao 33304ec9fa qcow2: fix offset overflow in qcow2_alloc_clusters_at()
When cluster size is big enough it can lead to an offset overflow
in qcow2_alloc_clusters_at(). This patch fixes it.

The allocation is stopped each time at L2 table boundary
(see handle_alloc()), so the possible maximum bytes could be

  2^(cluster_bits - 3 + cluster_bits)

cluster_bits - 3 is used to compute the number of entry by L2
and the additional cluster_bits is to take into account each
clusters referenced by the L2 entries.

so int is safe for cluster_bits<=17, unsafe otherwise.

Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Benoit Canet <benoit@irqsave.net>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2014-02-09 09:12:39 +01:00
2014-02-08 15:57:51 +00:00
2014-02-08 13:12:50 +00:00
2014-02-07 16:42:13 +00:00
2013-11-25 20:35:28 -08:00
2014-02-07 16:42:13 +00:00
2014-01-31 11:13:08 +00:00
2014-02-01 13:45:20 +04:00
2013-12-02 21:02:57 +04:00
2013-10-11 09:34:56 -07:00
2013-09-05 09:40:31 -05:00
2014-01-08 19:07:20 +00:00
2013-10-11 10:52:54 +02:00
2013-10-11 09:34:56 -07:00
2014-02-09 09:12:38 +01:00
2014-01-10 11:04:31 -08:00
2013-11-04 15:39:41 +02:00
2014-02-09 09:12:38 +01:00
2014-02-05 16:37:26 +00:00
2014-01-24 17:40:03 +01:00
2014-02-01 13:46:06 +04:00
2013-12-04 15:19:00 +01:00
2013-12-04 15:19:00 +01:00
2013-10-11 09:34:56 -07:00
2013-09-25 21:23:05 +02:00
2013-11-27 14:02:45 -08:00
2013-10-11 09:34:56 -07:00

Read the documentation in qemu-doc.html or on http://wiki.qemu-project.org

- QEMU team
Description
No description provided
Readme 404 MiB
Languages
C 82.6%
C++ 6.5%
Python 3.4%
Dylan 2.9%
Shell 1.6%
Other 2.8%