]> git.ipfire.org Git - thirdparty/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)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Thu, 3 Jul 2014 21:18:13 +0000 (16:18 -0500)
commitad08cae75c444366ad7a5222c6b7867f31a338f7
treed4fdff3813bd2dcf61630303e9314c1f611cefdd
parentdedf4a5f79d8dcb384c1324b44dae536ec938d9d
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>
(cherry picked from commit 73ed27ec28a1dbebdd2ae792284151f029950fbe)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
block/dmg.c