• P
    qemu-img: avoid overflow of min_sparse parameter · 6360ab27
    Peter Lieven 提交于
    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: NPeter Lieven <pl@kamp.de>
    Signed-off-by: NKevin Wolf <kwolf@redhat.com>
    6360ab27
qemu-img.c 144.4 KB