Re: [PATCH] Handle failed openvzLocateConfDir.

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

 



Jim Meyering <jim@xxxxxxxxxxxx> wrote:

> While looking at misuses of write, I found problems in src/openvz_conf.c
> Here's the first fix:
>
> 	Handle failed openvzLocateConfDir.
> 	* src/openvz_conf.c (openvzLocateConfDir, openvzGetVPSUUID):
> 	(openvzSetUUID): Don't dereference NULL upon failure.
>
> Signed-off-by: Jim Meyering <meyering@xxxxxxxxxx>
> ---
>  src/openvz_conf.c |    6 ++++++
>  1 files changed, 6 insertions(+), 0 deletions(-)
>
> diff --git a/src/openvz_conf.c b/src/openvz_conf.c
> index 482de82..fb38b43 100644
> --- a/src/openvz_conf.c
> +++ b/src/openvz_conf.c
> @@ -641,6 +641,8 @@ openvzGetVPSUUID(int vpsid, char *uuidstr)
>      int fd, ret;
>
>      conf_dir = openvzLocateConfDir();
> +    if (conf_dir != NULL)
> +        return -1

Oops.
Notice that missing semicolon.

That's because the fix is in the subsequent patch.
I'm redoing them now so they're independent.

FYI, with this series of three, all tests did pass.

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