From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34952) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YLaMb-00085X-6e for qemu-devel@nongnu.org; Wed, 11 Feb 2015 11:42:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YLaMX-0000tD-Uy for qemu-devel@nongnu.org; Wed, 11 Feb 2015 11:42:09 -0500 Received: from mx1.redhat.com ([209.132.183.28]:53042) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YLaMX-0000t7-Ns for qemu-devel@nongnu.org; Wed, 11 Feb 2015 11:42:05 -0500 Message-ID: <54DB8656.8050401@redhat.com> Date: Wed, 11 Feb 2015 17:41:58 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1423672645-12452-1-git-send-email-kraxel@redhat.com> In-Reply-To: <1423672645-12452-1-git-send-email-kraxel@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] vnc: fix coverity warning List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gerd Hoffmann , qemu-devel@nongnu.org Cc: Anthony Liguori 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 > --- > 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