mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-06 09:13:55 -06:00

It should neither become negative nor allow unbounded memory allocations. This fixes aborts in g_malloc() and an s->catalog_bitmap buffer overflow on big endian hosts. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
18 lines
617 B
Text
18 lines
617 B
Text
QA output created by 078
|
|
|
|
== Read from a valid image ==
|
|
read 512/512 bytes at offset 0
|
|
512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
|
|
|
|
== Negative catalog size ==
|
|
qemu-io: can't open device TEST_DIR/empty.bochs: Catalog size is too large
|
|
no file open, try 'help open'
|
|
|
|
== Overflow for catalog size * sizeof(uint32_t) ==
|
|
qemu-io: can't open device TEST_DIR/empty.bochs: Catalog size is too large
|
|
no file open, try 'help open'
|
|
|
|
== Too small catalog bitmap for image size ==
|
|
qemu-io: can't open device TEST_DIR/empty.bochs: Catalog size is too small for this disk size
|
|
no file open, try 'help open'
|
|
*** done
|