[Spice-devel] [PATCH spice-gtk 04/16] channel-main: Properly verify result in spice_main_file_copy_finish
Christophe Fergeau
cfergeau at redhat.com
Mon Apr 8 09:10:56 PDT 2013
ACK
On Fri, Mar 29, 2013 at 12:40:16PM +0100, Hans de Goede wrote:
> Call g_simple_async_result_is_valid on the passed in result to verify it is
> what we expect.
>
> Signed-off-by: Hans de Goede <hdegoede at redhat.com>
> ---
> gtk/channel-main.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/gtk/channel-main.c b/gtk/channel-main.c
> index 5f981c4..5d18366 100644
> --- a/gtk/channel-main.c
> +++ b/gtk/channel-main.c
> @@ -1568,7 +1568,7 @@ static void file_xfer_close_cb(GObject *object,
> res = g_simple_async_result_new(G_OBJECT(task->channel),
> task->callback,
> task->user_data,
> - file_xfer_continue_read);
> + spice_main_file_copy_async);
> if (task->error) {
> g_simple_async_result_take_error(res, task->error);
> g_simple_async_result_set_op_res_gboolean(res, FALSE);
> @@ -2772,7 +2772,8 @@ gboolean spice_main_file_copy_finish(SpiceMainChannel *channel,
> GSimpleAsyncResult *simple;
>
> g_return_val_if_fail(SPICE_IS_MAIN_CHANNEL(channel), FALSE);
> - g_return_val_if_fail(result != NULL, FALSE);
> + g_return_val_if_fail(g_simple_async_result_is_valid(result,
> + G_OBJECT(channel), spice_main_file_copy_async), FALSE);
>
> simple = (GSimpleAsyncResult *)result;
>
> --
> 1.8.1.4
>
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/spice-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/spice-devel/attachments/20130408/9672e77d/attachment.pgp>
More information about the Spice-devel
mailing list