[Spice-devel] [PATCH vd_agent_linux v3 1/2] Ignore some Coverity reports

Christophe Fergeau cfergeau at redhat.com
Mon Jan 7 16:58:13 UTC 2019


On Fri, Jan 04, 2019 at 10:56:23AM +0000, Frediano Ziglio wrote:
> 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 05fe41b..32bd6e6 100644
> --- a/src/udscs.c
> +++ b/src/udscs.c
> @@ -341,12 +341,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 53d3c48..02b4858 100644
> --- a/src/vdagent/x11.c
> +++ b/src/vdagent/x11.c
> @@ -393,6 +393,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

Not the easiest code to follow imo, not sure there's a better way to
write it though..


Acked-by: Christophe Fergeau <cfergeau at redhat.com>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20190107/1403c1d1/attachment.sig>


More information about the Spice-devel mailing list