From: Xiong Zhang Date: Thu, 13 Jul 2017 02:03:39 +0000 (+0800) Subject: tools/libxl: Fix a segment fault when mmio_hole is set in hvm.cfg X-Git-Tag: 4.10.0-rc1~726 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=614a14736e33fb84872eb00f08799ebbc73a96c6;p=people%2Fdariof%2Fxen.git tools/libxl: Fix a segment fault when mmio_hole is set in hvm.cfg 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 Acked-by: Wei Liu --- diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c index bffbc456c1..1158303e1a 100644 --- a/tools/libxl/libxl_create.c +++ b/tools/libxl/libxl_create.c @@ -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";