]> git.proxmox.com Git - qemu.git/blobdiff - vl.c
vl.c: Fix off-by-one bug when handling "-numa node" argument
[qemu.git] / vl.c
diff --git a/vl.c b/vl.c
index 315598994fe0bf973710dcfef8afd5ad284b669c..0dae44cd602bc866e0c21588239e47db3edd56ba 100644 (file)
--- a/vl.c
+++ b/vl.c
@@ -1253,7 +1253,10 @@ static void numa_add(const char *optarg)
 
     value = endvalue = 0ULL;
 
-    optarg = get_opt_name(option, 128, optarg, ',') + 1;
+    optarg = get_opt_name(option, 128, optarg, ',');
+    if (*optarg == ',') {
+        optarg++;
+    }
     if (!strcmp(option, "node")) {
         if (get_param_value(option, 128, "nodeid", optarg) == 0) {
             nodenr = nb_numa_nodes;