qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] vnc: fix coverity warning
@ 2015-02-11 16:37 Gerd Hoffmann
  2015-02-11 16:41 ` Paolo Bonzini
  0 siblings, 1 reply; 4+ messages in thread
From: Gerd Hoffmann @ 2015-02-11 16:37 UTC (permalink / raw)
  To: qemu-devel; +Cc: Paolo Bonzini, Gerd Hoffmann, Anthony Liguori

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 <kraxel@redhat.com>
---
 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);
 }
 
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-02-12  9:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-11 16:37 [Qemu-devel] [PATCH] vnc: fix coverity warning Gerd Hoffmann
2015-02-11 16:41 ` Paolo Bonzini
2015-02-11 16:48   ` Gerd Hoffmann
2015-02-12  9:27     ` Markus Armbruster

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).