aboutsummaryrefslogtreecommitdiff
path: root/monitor.c
diff options
context:
space:
mode:
authorPeter Wu <peter@lekensteyn.nl>2015-01-06 18:48:06 +0100
committerKevin Wolf <kwolf@redhat.com>2015-02-06 17:24:21 +0100
commitb0e8dc5d54225d2e7012bd306e62ac90ba6fc1ea (patch)
tree87a4cf208036a168023c00f12031be8ca78a4ca3 /monitor.c
parent65a1c7c96a64cd69269c9ba854fa347dd0bbda0b (diff)
downloadqemu-b0e8dc5d54225d2e7012bd306e62ac90ba6fc1ea.zip
qemu-b0e8dc5d54225d2e7012bd306e62ac90ba6fc1ea.tar.gz
qemu-b0e8dc5d54225d2e7012bd306e62ac90ba6fc1ea.tar.bz2
block/dmg: extract processing of resource forks
Besides the offset, also read the resource length. This length is now used in the extracted function to verify the end of the resource fork against "count" from the resource fork. Instead of relying on the value of offset to conclude whether the resource fork is available or not (info_begin==0), check the rsrc_fork_length instead. This would allow a dmg file to begin with a resource fork. This seemingly unnecessary restriction was found while trying to craft a DMG file by hand. Other changes: - Do not require resource data offset to be 0x100 (but check that it is within bounds though). - Further improve boundary checking (resource data must be within the resource fork). - Use correct value for resource data length (spotted by John Snow) - Consider the resource data offset when determining info_end. This fixes an EINVAL on the tuxpaint dmg example. The resource fork format is documented at https://developer.apple.com/legacy/library/documentation/mac/pdf/MoreMacintoshToolbox.pdf#page=151 Signed-off-by: Peter Wu <peter@lekensteyn.nl> Reviewed-by: John Snow <jsnow@redhat.com> Message-id: 1420566495-13284-4-git-send-email-peter@lekensteyn.nl Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'monitor.c')
0 files changed, 0 insertions, 0 deletions