[gnome-software/wip/rancell/reviews] gs-ubuntuone: Don't early exit from the libsecret callbacks if one fails
- From: Iain Lane <iainl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software/wip/rancell/reviews] gs-ubuntuone: Don't early exit from the libsecret callbacks if one fails
- Date: Wed, 6 Apr 2016 16:12:41 +0000 (UTC)
commit 6ce58ad1ffbc3ec324216354b4d1d1ea4abe630e
Author: Iain Lane <iain orangesquash org uk>
Date: Wed Apr 6 16:43:40 2016 +0100
gs-ubuntuone: Don't early exit from the libsecret callbacks if one fails
This is for the no credentials case.
Otherwise we exit from _get_credentials and then there's a
use-after-free when the other ones return.
src/plugins/gs-ubuntuone.c | 20 ++++----------------
1 files changed, 4 insertions(+), 16 deletions(-)
---
diff --git a/src/plugins/gs-ubuntuone.c b/src/plugins/gs-ubuntuone.c
index 9fe63a1..9552256 100644
--- a/src/plugins/gs-ubuntuone.c
+++ b/src/plugins/gs-ubuntuone.c
@@ -59,10 +59,7 @@ lookup_consumer_key (GObject *source_object,
g_mutex_lock (&context->mutex);
- if (context->consumer_key != NULL)
- context->waiting--;
- else
- context->waiting = 0;
+ context->waiting--;
g_cond_signal (&context->cond);
g_mutex_unlock (&context->mutex);
@@ -79,10 +76,7 @@ lookup_consumer_secret (GObject *source_object,
g_mutex_lock (&context->mutex);
- if (context->consumer_secret != NULL)
- context->waiting--;
- else
- context->waiting = 0;
+ context->waiting--;
g_cond_signal (&context->cond);
g_mutex_unlock (&context->mutex);
@@ -99,10 +93,7 @@ lookup_token_key (GObject *source_object,
g_mutex_lock (&context->mutex);
- if (context->token_key != NULL)
- context->waiting--;
- else
- context->waiting = 0;
+ context->waiting--;
g_cond_signal (&context->cond);
g_mutex_unlock (&context->mutex);
@@ -119,10 +110,7 @@ lookup_token_secret (GObject *source_object,
g_mutex_lock (&context->mutex);
- if (context->token_secret != NULL)
- context->waiting--;
- else
- context->waiting = 0;
+ context->waiting--;
g_cond_signal (&context->cond);
g_mutex_unlock (&context->mutex);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]