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 <joao.m.martins@oracle.com>
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) {