[gnome-online-accounts] httpclient: Be more strict about what is acceptable



commit c9531fc2d809b96e1e2c2f0c2141aa7a990e4f0c
Author: Debarshi Ray <debarshir gnome org>
Date:   Mon Jan 9 17:51:09 2017 +0100

    httpclient: Be more strict about what is acceptable

 src/goabackend/goahttpclient.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/src/goabackend/goahttpclient.c b/src/goabackend/goahttpclient.c
index 4f19f65..f7b06e0 100644
--- a/src/goabackend/goahttpclient.c
+++ b/src/goabackend/goahttpclient.c
@@ -269,6 +269,7 @@ goa_http_client_check_finish (GoaHttpClient *self, GAsyncResult *res, GError **e
 {
   GSimpleAsyncResult *simple;
 
+  g_return_val_if_fail (GOA_IS_HTTP_CLIENT (self), FALSE);
   g_return_val_if_fail (g_simple_async_result_is_valid (res, G_OBJECT (self), goa_http_client_check), FALSE);
   g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
 
@@ -310,6 +311,13 @@ goa_http_client_check_sync (GoaHttpClient       *self,
   CheckSyncData data;
   GMainContext *context = NULL;
 
+  g_return_val_if_fail (GOA_IS_HTTP_CLIENT (self), FALSE);
+  g_return_val_if_fail (uri != NULL && uri[0] != '\0', FALSE);
+  g_return_val_if_fail (username != NULL && username[0] != '\0', FALSE);
+  g_return_val_if_fail (password != NULL && password[0] != '\0', FALSE);
+  g_return_val_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable), FALSE);
+  g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
+
   data.error = error;
 
   context = g_main_context_new ();


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]