Alberto Garcia 9883975050 qcow2: Prevent allocating L2 tables at offset 0
If the refcount data is corrupted then we can end up trying to
allocate a new L2 table at offset 0 in the image, triggering an
assertion in the qcow2 cache that would crash QEMU:

  qcow2_cache_entry_mark_dirty: Assertion `c->entries[i].offset != 0' failed

This patch adds an explicit check for this scenario and a new test
case.

Signed-off-by: Alberto Garcia <berto@igalia.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Message-id: 92dac37191ae7844a2da22c122204eb493cc3133.1509718618.git.berto@igalia.com
Signed-off-by: Max Reitz <mreitz@redhat.com>
2017-11-14 18:06:25 +01:00
..
2017-09-22 10:46:25 +08:00
2017-10-11 15:15:17 -03:00
2017-10-16 20:57:06 +03:00
2017-10-20 13:32:10 +02:00
2017-10-20 13:32:10 +02:00
2017-10-20 13:32:10 +02:00
2017-10-20 13:32:10 +02:00
2017-09-15 09:05:19 +02:00
2017-10-20 13:32:10 +02:00
2017-10-20 13:32:10 +02:00