aboutsummaryrefslogtreecommitdiff
path: root/qdev-monitor.c
diff options
context:
space:
mode:
authorPeter Lieven <pl@kamp.de>2018-07-13 09:15:39 +0200
committerKevin Wolf <kwolf@redhat.com>2018-07-23 16:50:43 +0200
commit6360ab278cc1ac3e1235e0755e4cba1f918e6f3c (patch)
tree9f92ac840c9baa83e849040823e2e2dba5a71627 /qdev-monitor.c
parent50d6a8a352af164a3335d510af38b9545d568676 (diff)
downloadqemu-6360ab278cc1ac3e1235e0755e4cba1f918e6f3c.zip
qemu-6360ab278cc1ac3e1235e0755e4cba1f918e6f3c.tar.gz
qemu-6360ab278cc1ac3e1235e0755e4cba1f918e6f3c.tar.bz2
qemu-img: avoid overflow of min_sparse parameter
the min_sparse convert parameter can overflow (e.g. -S 1024G) in the conversion from int64_t to int resulting in a negative min_sparse parameter. Avoid this by limiting the valid parameters to sane values. In fact anything exceeding the convert buffer size is also pointless. While at it also forbid values that are non multiple of 512 to avoid undesired behaviour. For instance, values between 1 and 511 were legal, but resulted in full allocation. Cc: qemu-stable@nongnu.org Signed-off-by: Peter Lieven <pl@kamp.de> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'qdev-monitor.c')
0 files changed, 0 insertions, 0 deletions