summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2013-03-09 11:50:19 +0100
committerHans de Goede <hdegoede@redhat.com>2013-04-09 13:12:06 +0200
commitf92612eb37f4e46632b62065222205a02313b122 (patch)
tree5e5f6ec975aab88bebc20c46cbba4b9e816d01ac
parent14fc12b844b29af47793c825fe798986e22c3abc (diff)
channel-main: Properly verify result in spice_main_file_copy_finish
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@redhat.com>
-rw-r--r--gtk/channel-main.c5
1 files 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;