mirror of
https://github.com/xemu-project/xemu.git
synced 2024-12-20 02:48:36 +00:00
d65f97a82c
Avoid unbounded s->uncompressed_block memory allocation by checking that the block_size header field has a reasonable value. Also enforce the assumption that the value is a non-zero multiple of 512. These constraints conform to cloop 2.639's code so we accept existing image files. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
19 lines
647 B
Plaintext
19 lines
647 B
Plaintext
QA output created by 075
|
|
|
|
== check that the first sector can be read ==
|
|
read 512/512 bytes at offset 0
|
|
512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
|
|
|
|
== block_size must be a multiple of 512 ==
|
|
qemu-io: can't open device TEST_DIR/simple-pattern.cloop: block_size 513 must be a multiple of 512
|
|
no file open, try 'help open'
|
|
|
|
== block_size cannot be zero ==
|
|
qemu-io: can't open device TEST_DIR/simple-pattern.cloop: block_size cannot be zero
|
|
no file open, try 'help open'
|
|
|
|
== huge block_size ===
|
|
qemu-io: can't open device TEST_DIR/simple-pattern.cloop: block_size 4294966784 must be 64 MB or less
|
|
no file open, try 'help open'
|
|
*** done
|