[virt-tools-list] [PATCH virt-viewer] spice: avoid crash if connection failed without error

Jonathon Jongsma jjongsma at redhat.com
Mon Jul 21 16:47:03 UTC 2014


On Mon, Jul 21, 2014 at 10:59 AM, Marc-André Lureau 
<marcandre.lureau at gmail.com> wrote:
> spice_channel_get_error() is not guarantee to return a GError.
> ---
>  src/virt-viewer-session-spice.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/virt-viewer-session-spice.c 
> b/src/virt-viewer-session-spice.c
> index 2d4e67d..8b90d66 100644
> --- a/src/virt-viewer-session-spice.c
> +++ b/src/virt-viewer-session-spice.c
> @@ -547,7 +547,7 @@ 
> virt_viewer_session_spice_main_channel_event(SpiceChannel *channel 
> G_GNUC_UNUSED
>                  spice_session_connect(self->priv->session);
>              }
>          } else {
> -            g_signal_emit_by_name(session, "session-disconnected", 
> error->message);
> +            g_signal_emit_by_name(session, "session-disconnected", 
> error ? error->message : NULL);
>          }
>      }
>  #else
> -- 
> 1.9.3
> 
> _______________________________________________
> virt-tools-list mailing list
> virt-tools-list at redhat.com
> https://www.redhat.com/mailman/listinfo/virt-tools-list


ACK.  

In some ways, I think it would be nicer if the "session-disconnected" 
signal actually passed the whole GError along instead of just the 
message. But I'm not sure it's worth changing now. Is there a related 
bug for this issue?  If so, can you add a reference to the commit 
message?

Jonathon





More information about the virt-tools-list mailing list