]> git.proxmox.com Git - mirror_qemu.git/commit
block/sheepdog: fix argument passed to qemu_strtoul()
authorJeff Cody <jcody@redhat.com>
Wed, 2 Mar 2016 16:24:42 +0000 (11:24 -0500)
committerJeff Cody <jcody@redhat.com>
Wed, 16 Mar 2016 17:25:29 +0000 (13:25 -0400)
commit03c698f0a229c8f76cfc33f0d8f755047c41f5e6
tree672c07ee582656b398d065ccec2a7cfc35ef2199
parent0ebc03bc065329eaefb6493f5fa7df08df528f2a
block/sheepdog: fix argument passed to qemu_strtoul()

The function qemu_strtoul() reads 'unsigned long' sized data,
which is larger than uint32_t on 64-bit machines.

Even though the snap_id field in the header is 32-bits, we must
accommodate the full size in qemu_strtoul().

This patch also adds more meaningful error handling to the
qemu_strtoul() call, and subsequent results.

Reported-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Jeff Cody <jcody@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Hitoshi Mitake <mitake.hitoshi@lab.ntt.co.jp>
Message-id: e56fc50abedd9a112e0683342c8eafda063cd2f9.1456935548.git.jcody@redhat.com
block/sheepdog.c