]> git.proxmox.com Git - mirror_qemu.git/commit - qemu-io.c
qemu-io: better input validation for vector-based commands
authorChristoph Hellwig <hch@lst.de>
Fri, 10 Jul 2009 11:33:42 +0000 (13:33 +0200)
committerAnthony Liguori <aliguori@us.ibm.com>
Fri, 10 Jul 2009 17:25:36 +0000 (12:25 -0500)
commitcf57298af5336df2aece47ef16c290a3a81457dd
tree41b562b598b46c29a3c33a9839debe73a1588850
parent230d4fa48bd64dbc07b509e0eb0bbc885ddf4cc8
qemu-io: better input validation for vector-based commands

Fix up a couple of issues with validating the input of the various
length arguments for the vectored I/O commands:

 - do the alignment check on each length instead the always 0 count argument
 - use a long long varibale for the cvtnum return value so that we can check
   wether it wasn't a number
 - check for a too large argument instead of truncating it

Also refactor it into a common helper for all four calers and avoid parsing
the numbers twice.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
qemu-io.c