[PATCH 08/23] Add missing check for OOM with virVMXEscapeHexPipe

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

 



From: "Daniel P. Berrange" <berrange@xxxxxxxxxx>

The virVMXFormatConfig called virVMXEscapeHexPipe but
forgot to check for OOM. This caused data to silently
be lost.

Signed-off-by: Daniel P. Berrange <berrange@xxxxxxxxxx>
---
 src/vmx/vmx.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/vmx/vmx.c b/src/vmx/vmx.c
index 5c2c794..38b7cc0 100644
--- a/src/vmx/vmx.c
+++ b/src/vmx/vmx.c
@@ -3096,7 +3096,8 @@ virVMXFormatConfig(virVMXContext *ctx, virDomainXMLOptionPtr xmlopt, virDomainDe
 
     /* def:description -> vmx:annotation */
     if (def->description != NULL) {
-        annotation = virVMXEscapeHexPipe(def->description);
+        if (!(annotation = virVMXEscapeHexPipe(def->description)))
+            goto cleanup;
 
         virBufferAsprintf(&buffer, "annotation = \"%s\"\n", annotation);
     }
-- 
1.8.3.1

--
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]