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

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



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 redhat com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


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