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 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. */ --