diff --git a/src/conf/cpu_conf.c b/src/conf/cpu_conf.c index 2650208901..67203c6094 100644 --- a/src/conf/cpu_conf.c +++ b/src/conf/cpu_conf.c @@ -658,7 +658,7 @@ virCPUDefFormatBuf(virBufferPtr buf, virBufferAddLit(buf, "/>\n"); } - for (i = 0; i < def->nfeatures; i++) { + for (i = 0; formatModel && i < def->nfeatures; i++) { virCPUFeatureDefPtr feature = def->features + i; if (!feature->name) {