From: Joao Martins Date: Wed, 8 Feb 2017 12:32:36 +0000 (+0000) Subject: xenconfig: fix xml to xl.cfg conversion with no graphics X-Git-Tag: CVE-2017-2635~163 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=91ac80a9863d8b6c5c1fa64419c38d3bb474037d;p=thirdparty%2Flibvirt.git xenconfig: fix xml to xl.cfg conversion with no graphics If no graphics element is in XML xenFormatXLSpice will access graphics without checking it has one in the first place, leading to a segmentation fault. Signed-off-by: Joao Martins --- diff --git a/src/xenconfig/xen_xl.c b/src/xenconfig/xen_xl.c index 2c9174e536..74f68b38db 100644 --- a/src/xenconfig/xen_xl.c +++ b/src/xenconfig/xen_xl.c @@ -1168,7 +1168,7 @@ xenFormatXLSpice(virConfPtr conf, virDomainDefPtr def) virDomainGraphicsListenDefPtr glisten; virDomainGraphicsDefPtr graphics; - if (def->os.type == VIR_DOMAIN_OSTYPE_HVM) { + if (def->os.type == VIR_DOMAIN_OSTYPE_HVM && def->graphics) { graphics = def->graphics[0]; if (graphics->type == VIR_DOMAIN_GRAPHICS_TYPE_SPICE) {