]> xenbits.xensource.com Git - xen.git/commitdiff
tools/libxl: Fix a segment fault when mmio_hole is set in hvm.cfg
authorXiong Zhang <xiong.y.zhang@intel.com>
Thu, 13 Jul 2017 02:03:39 +0000 (10:03 +0800)
committerWei Liu <wei.liu2@citrix.com>
Wed, 12 Jul 2017 10:21:37 +0000 (11:21 +0100)
When valid mmio_hole is set in hvm.cfg, segment fault happens at accessing
localents pointer.

Because the size of localents pointer isn't enough to store appended
mmio_hole_size parameter.

Signed-off-by: Xiong Zhang <xiong.y.zhang@intel.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
tools/libxl/libxl_create.c

index bffbc456c18891cbc61db7559987ddc5667de6ba..1158303e1a03aaecd90bf129dda12213eb266b01 100644 (file)
@@ -451,7 +451,7 @@ int libxl__domain_build(libxl__gc *gc,
         vments[4] = "start_time";
         vments[5] = GCSPRINTF("%lu.%02d", start_time.tv_sec,(int)start_time.tv_usec/10000);
 
-        localents = libxl__calloc(gc, 9, sizeof(char *));
+        localents = libxl__calloc(gc, 11, sizeof(char *));
         i = 0;
         localents[i++] = "platform/acpi";
         localents[i++] = libxl__acpi_defbool_val(info) ? "1" : "0";