Re: [PATCH 7/9] Avoid referencing NULL pointer when copying stream error

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

 



On 06/28/2011 11:01 AM, Daniel P. Berrange wrote:
> * src/rpc/virnetclientstream.c: Avoid referencing NULL
> ---
>  src/rpc/virnetclientstream.c |   21 ++++++++++++++++-----
>  1 files changed, 16 insertions(+), 5 deletions(-)
> 
> diff --git a/src/rpc/virnetclientstream.c b/src/rpc/virnetclientstream.c
> index 44c9acf..99c7b41 100644
> --- a/src/rpc/virnetclientstream.c
> +++ b/src/rpc/virnetclientstream.c
> @@ -217,13 +217,24 @@ int virNetClientStreamSetError(virNetClientStreamPtr st,
>      } else {
>          st->err.code = err.code;
>      }
> -    st->err.message = *err.message;
> -    *err.message = NULL;
> +    if (err.message) {
> +        st->err.message = *err.message;
> +        *err.message = NULL;
> +    }

ACK.

-- 
Eric Blake   eblake@xxxxxxxxxx    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

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