[patch 2/2] Dont crash if theres no /sys/hypervisor/capabilities

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

 



xenHypervisorMakeCapabilitiesXML() can be called with either
of it's FILE* paramaters NULL; don't crash when the capabilities
pointer is NULL.

Signed-off-by: Mark McLoughlin <markmc@xxxxxxxxxx>
Index: libvirt/src/xen_internal.c
===================================================================
--- libvirt.orig/src/xen_internal.c	2008-02-06 22:38:06.000000000 +0000
+++ libvirt/src/xen_internal.c	2008-02-06 23:38:54.000000000 +0000
@@ -2233,7 +2233,7 @@
      */
 
     /* Expecting one line in this file - ignore any more. */
-    if (fgets (line, sizeof line, capabilities)) {
+    if (capabilities && fgets (line, sizeof line, capabilities)) {
         /* Split the line into tokens.  strtok_r is OK here because we "own"
          * this buffer.  Parse out the features from each token.
          */

-- 

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