[Libvir] [patch 2/2] Dont crash if theres no /sys/hypervisor/capabilities
Jim Meyering
jim at meyering.net
Thu Feb 7 08:15:19 UTC 2008
Mark McLoughlin <markmc at redhat.com> wrote:
> 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 at redhat.com>
> 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.
> */
+1
More information about the libvir-list
mailing list