aboutsummaryrefslogtreecommitdiff
path: root/balloon.c
diff options
context:
space:
mode:
authorEduardo Habkost <ehabkost@redhat.com>2013-02-04 16:27:46 -0200
committerAnthony Liguori <aliguori@us.ibm.com>2013-02-04 14:38:33 -0600
commit8f302cb0900ba7f38b62da5759f07b77483d6fb9 (patch)
tree0f26199120523780c5f9a48d4d5dad488bbe3838 /balloon.c
parente3f9fe2d404ca10153e95499ece111c077b6690a (diff)
vl.c: Fix off-by-one bug when handling "-numa node" argument
The numa_add() code was unconditionally adding 1 to the get_opt_name() return value, making it point after the end of the string if no ',' separator is present. Example of weird behavior caused by the bug: $ qemu-img create -f qcow2 this-file-image-has,cpus=5,mem=1000,in-its-name.qcow2 5G Formatting 'this-file-image-has,cpus=5,mem=1000,in-its-name.qcow2', fmt=qcow2 size=5368709120 encryption=off cluster_size=65536 $ ./x86_64-softmmu/qemu-system-x86_64 -S -monitor stdio -numa node 'this-file-image-has,cpus=5,mem=1000,in-its-name.qcow2' QEMU 1.3.50 monitor - type 'help' for more information (qemu) info numa 1 nodes node 0 cpus: 0 node 0 size: 1000 MB (qemu) This changes the code to nove the pointer only if ',' is found. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'balloon.c')
0 files changed, 0 insertions, 0 deletions