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

Re: [Xen-devel] [PATCH] tools/xl: fix uninitialized variable in xl_vdispl





On Tue, Mar 13, 2018 at 10:03 AM, Jan Beulich <JBeulich@xxxxxxxx> wrote:
>>> On 13.03.18 at 05:43, <cardoe@xxxxxxxxxx> wrote:
> The code added in 7a48622a78a0b452e8afa55b8442c958abd226a7 could use rc
> uninitialized in main_vdisplattach().
>
> Signed-off-by: Doug Goldstein <cardoe@xxxxxxxxxx>
> ---
> CC: Oleksandr Grytsov <oleksandr_grytsov@xxxxxxxx>
> ---
>  tools/xl/xl_vdispl.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Please trim your Cc list - I've removed all individuals here, and I
don't see why you've copied all REST maintainers when this is
clearly a pure tool stack change.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel


Hi, Doug,

Thanks for pointing it out.

The implementation is done according to CODING_STYLE document (see ERROR HANDLING)
which requests to define return value rc uninitialized. The only path where rc is uninitialized it is
when dryrun_only set to true. So, proper fix should be:

    if (dryrun_only) {
        char *json = libxl_device_vdispl_to_json(ctx, &vdispl);
        printf("vdispl: %s\n", json);
        free(json);
+      rc = 0;
        goto out;
    }


--
Best Regards,
Oleksandr Grytsov.
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.