[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] vnc: fix coverity warning
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH] vnc: fix coverity warning |
Date: |
Wed, 11 Feb 2015 17:41:58 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 |
On 11/02/2015 17:37, Gerd Hoffmann wrote:
> vnc_display_local_addr will not be called with an invalid display id.
> Add assert() to silence coverity warning about a null pointer dereference.
>
> Signed-off-by: Gerd Hoffmann <address@hidden>
> ---
> ui/vnc.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/ui/vnc.c b/ui/vnc.c
> index e291987..25ba340 100644
> --- a/ui/vnc.c
> +++ b/ui/vnc.c
> @@ -3252,6 +3252,7 @@ char *vnc_display_local_addr(const char *id)
> {
> VncDisplay *vs = vnc_display_find(id);
>
> + assert(vs);
> return vnc_socket_local_addr("%s:%s", vs->lsock);
> }
>
>
If you want, I can just silence the warning in Coverity.
Paolo