]> Git Repo - qemu.git/commitdiff
virtio-9p: Make sure -virtfs option works correctly
authorAneesh Kumar K.V <[email protected]>
Thu, 2 Sep 2010 16:17:59 +0000 (21:47 +0530)
committerBlue Swirl <[email protected]>
Sat, 4 Sep 2010 09:52:53 +0000 (09:52 +0000)
When making copy of arguments we were doing partial copy

Signed-off-by: Aneesh Kumar K.V <[email protected]>
Signed-off-by: Blue Swirl <[email protected]>
vl.c

diff --git a/vl.c b/vl.c
index bd05e39b3e682e540d55a45a9251784d71308279..fd491bafa6c0685c6d3c3a7b52b6a7d877d16fe6 100644 (file)
--- a/vl.c
+++ b/vl.c
@@ -2332,7 +2332,7 @@ int main(int argc, char **argv, char **envp)
                 len += strlen(qemu_opt_get(opts, "security_model"));
                 arg_fsdev = qemu_malloc((len + 1) * sizeof(*arg_fsdev));
 
-                snprintf(arg_fsdev, len * sizeof(*arg_fsdev),
+                snprintf(arg_fsdev, (len + 1) * sizeof(*arg_fsdev),
                          "%s,id=%s,path=%s,security_model=%s",
                          qemu_opt_get(opts, "fstype"),
                          qemu_opt_get(opts, "mount_tag"),
@@ -2343,7 +2343,7 @@ int main(int argc, char **argv, char **envp)
                 len += 2*strlen(qemu_opt_get(opts, "mount_tag"));
                 arg_9p = qemu_malloc((len + 1) * sizeof(*arg_9p));
 
-                snprintf(arg_9p, len * sizeof(*arg_9p),
+                snprintf(arg_9p, (len + 1) * sizeof(*arg_9p),
                          "virtio-9p-pci,fsdev=%s,mount_tag=%s",
                          qemu_opt_get(opts, "mount_tag"),
                          qemu_opt_get(opts, "mount_tag"));
This page took 0.029182 seconds and 4 git commands to generate.