mirror of
https://github.com/brl/mutter.git
synced 2024-11-25 09:30:45 -05:00
x11: Do not trust there is task in error paths
Flushing the X11 selection output stream may happen synchronously or
implicitly, in which case there is not a task to complete. Check there
is actually a task before returning errors. We additionally set the
pipe_error flag, so future operations will fail with an error, albeit
with a more generic message.
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1198
(cherry picked from commit 1909977a67
)
This commit is contained in:
parent
1e17f8813b
commit
20cf6b630d
@ -282,6 +282,8 @@ meta_x11_selection_output_stream_perform_flush (MetaX11SelectionOutputStream *st
|
|||||||
priv->delete_pending = FALSE;
|
priv->delete_pending = FALSE;
|
||||||
priv->pipe_error = TRUE;
|
priv->pipe_error = TRUE;
|
||||||
|
|
||||||
|
if (priv->pending_task)
|
||||||
|
{
|
||||||
XGetErrorText (xdisplay, error_code, error_str, sizeof (error_str));
|
XGetErrorText (xdisplay, error_code, error_str, sizeof (error_str));
|
||||||
g_task_return_new_error (priv->pending_task,
|
g_task_return_new_error (priv->pending_task,
|
||||||
G_IO_ERROR,
|
G_IO_ERROR,
|
||||||
@ -290,6 +292,7 @@ meta_x11_selection_output_stream_perform_flush (MetaX11SelectionOutputStream *st
|
|||||||
error_str);
|
error_str);
|
||||||
g_clear_object (&priv->pending_task);
|
g_clear_object (&priv->pending_task);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else if (priv->pending_task && priv->data->len == 0 && !priv->delete_pending)
|
else if (priv->pending_task && priv->data->len == 0 && !priv->delete_pending)
|
||||||
{
|
{
|
||||||
size_t result;
|
size_t result;
|
||||||
|
Loading…
Reference in New Issue
Block a user