]> git.proxmox.com Git - mirror_qemu.git/commit
dmg: prevent out-of-bounds array access on terminator
authorStefan Hajnoczi <stefanha@redhat.com>
Wed, 26 Mar 2014 12:05:55 +0000 (13:05 +0100)
committerStefan Hajnoczi <stefanha@redhat.com>
Tue, 1 Apr 2014 13:22:35 +0000 (15:22 +0200)
commit73ed27ec28a1dbebdd2ae792284151f029950fbe
tree9b35d05f937d38cbd85e1d4fd3a4d707f988da88
parent2c1885adcf0312da80c7317b09f9adad97fa0fc6
dmg: prevent out-of-bounds array access on terminator

When a terminator is reached the base for offsets and sectors is stored.
The following records that are processed will use this base value.

If the first record we encounter is a terminator, then calculating the
base values would result in out-of-bounds array accesses.  Don't do
that.

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>
block/dmg.c