[Spice-devel] [PATCH vd_agent_linux v2 2/7] Ignore some Coverity reports

Frediano Ziglio fziglio at redhat.com
Fri Jan 4 08:37:00 UTC 2019


Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
---
 src/udscs.c                | 2 ++
 src/vdagent/x11.c          | 2 ++
 src/vdagentd/virtio-port.c | 1 +
 3 files changed, 5 insertions(+)

diff --git a/src/udscs.c b/src/udscs.c
index 7fe74b9..fe2cf8c 100644
--- a/src/udscs.c
+++ b/src/udscs.c
@@ -343,12 +343,14 @@ static gboolean udscs_io_channel_cb(GIOChannel *source,
 
     if (condition & G_IO_IN) {
         udscs_do_read(&conn);
+        // coverity[check_after_deref] previous function can change conn
         if (conn == NULL)
             return G_SOURCE_REMOVE;
         return G_SOURCE_CONTINUE;
     }
     if (condition & G_IO_OUT) {
         udscs_do_write(&conn);
+        // coverity[check_after_deref] previous function can change conn
         if (conn == NULL)
             return G_SOURCE_REMOVE;
         if (conn->write_buf)
diff --git a/src/vdagent/x11.c b/src/vdagent/x11.c
index c3c7a65..c9c2e02 100644
--- a/src/vdagent/x11.c
+++ b/src/vdagent/x11.c
@@ -395,6 +395,7 @@ static void vdagent_x11_set_clipboard_owner(struct vdagent_x11 *x11,
                 x11->selection_req_data_size = 0;
                 x11->selection_req_atom = None;
             } else {
+                // coverity[var_deref_op] if it is not the first there's a previous
                 prev_sel->next = next_sel;
             }
             free(curr_sel);
@@ -423,6 +424,7 @@ static void vdagent_x11_set_clipboard_owner(struct vdagent_x11 *x11,
                 x11->clipboard_data_size = 0;
                 x11->expect_property_notify = 0;
             } else {
+                // coverity[var_deref_op] if it is not the first there's a previous
                 prev_conv->next = next_conv;
             }
             free(curr_conv);
diff --git a/src/vdagentd/virtio-port.c b/src/vdagentd/virtio-port.c
index c037603..7c04177 100644
--- a/src/vdagentd/virtio-port.c
+++ b/src/vdagentd/virtio-port.c
@@ -424,6 +424,7 @@ static void vdagent_virtio_port_do_read(struct vdagent_virtio_port **vportp)
         vport->chunk_data_pos += n;
         if (vport->chunk_data_pos == vport->chunk_header.size) {
             vdagent_virtio_port_do_chunk(vportp);
+            // coverity[check_after_deref] previous function can change *vportd
             if (!*vportp)
                 return;
             vport->chunk_header_read = 0;
-- 
2.20.1



More information about the Spice-devel mailing list