aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--vl.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/vl.c b/vl.c
index 89de00398f..4955c2972d 100644
--- a/vl.c
+++ b/vl.c
@@ -1249,7 +1249,7 @@ static void numa_add(const char *optarg)
char option[128];
char *endptr;
unsigned long long value, endvalue;
- int nodenr;
+ unsigned long long nodenr;
value = endvalue = 0ULL;
@@ -1270,6 +1270,11 @@ static void numa_add(const char *optarg)
nodenr = strtoull(option, NULL, 10);
}
+ if (nodenr >= MAX_NODES) {
+ fprintf(stderr, "qemu: invalid NUMA nodeid: %llu\n", nodenr);
+ exit(1);
+ }
+
if (get_param_value(option, 128, "mem", optarg) == 0) {
node_mem[nodenr] = 0;
} else {