[PATCH] cpu_conf: properly escape characters for model and vendor

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



We should escape strings for those two elements to be consistent along
the whole XML.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1197580

Signed-off-by: Pavel Hrdina <phrdina@xxxxxxxxxx>
---
 src/conf/cpu_conf.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/conf/cpu_conf.c b/src/conf/cpu_conf.c
index e959ecc..34725c0 100644
--- a/src/conf/cpu_conf.c
+++ b/src/conf/cpu_conf.c
@@ -547,14 +547,14 @@ virCPUDefFormatBuf(virBufferPtr buf,
                 virBufferAsprintf(buf, " vendor_id='%s'", def->vendor_id);
         }
         if (formatModel && def->model) {
-            virBufferAsprintf(buf, ">%s</model>\n", def->model);
+            virBufferEscapeString(buf, ">%s</model>\n", def->model);
         } else {
             virBufferAddLit(buf, "/>\n");
         }
     }
 
     if (formatModel && def->vendor)
-        virBufferAsprintf(buf, "<vendor>%s</vendor>\n", def->vendor);
+        virBufferEscapeString(buf, "<vendor>%s</vendor>\n", def->vendor);
 
     if (def->sockets && def->cores && def->threads) {
         virBufferAddLit(buf, "<topology");
-- 
2.3.6

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]