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

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



Mark McLoughlin <markmc 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 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


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