[Commits] [SCM] claws branch, master, updated. 4.1.0-22-g964a11831

miras at claws-mail.org miras at claws-mail.org
Sat May 21 10:35:54 CEST 2022


The branch, master has been updated
       via  964a118312e2b13d767051a4b0cb58fecda96e8a (commit)
       via  0148b9569364ca9612e6c1120163f5f48369a2ca (commit)
       via  30f5f9f83b22c007fe4bbe514f541505d240316d (commit)
      from  6476ca3deb850d69d0ed1853f0be2f76e7cc7473 (commit)

Summary of changes:
 src/prefs_account.c | 56 +++++++++++++++++++++++++++--------------------------
 1 file changed, 29 insertions(+), 27 deletions(-)


- Log -----------------------------------------------------------------
commit 964a118312e2b13d767051a4b0cb58fecda96e8a
Author: Michael Rasmussen <mir at datanom.net>
Date:   Sat May 21 10:35:09 2022 +0200

    fix CID 1504463
    
    Signed-off-by: Michael Rasmussen <mir at datanom.net>

diff --git a/src/prefs_account.c b/src/prefs_account.c
index 9ff21ef3c..6e043271f 100644
--- a/src/prefs_account.c
+++ b/src/prefs_account.c
@@ -6047,6 +6047,7 @@ static void * prefs_account_oauth2_listener(void * param)
 	//Bind
 	if( bind(socket_desc,(struct sockaddr *)&server , sizeof(server)) < 0)
 	{
+                close(socket_desc);
 		debug_print("oauth2 listener bind failed\n");
 		return NULL;
 	}

commit 0148b9569364ca9612e6c1120163f5f48369a2ca
Author: Michael Rasmussen <mir at datanom.net>
Date:   Sat May 21 10:31:59 2022 +0200

    fix CID 1504464
    
    Signed-off-by: Michael Rasmussen <mir at datanom.net>

diff --git a/src/prefs_account.c b/src/prefs_account.c
index fc6db6afb..9ff21ef3c 100644
--- a/src/prefs_account.c
+++ b/src/prefs_account.c
@@ -5142,8 +5142,8 @@ static void prefs_account_oauth2_copy_url(GtkButton *button, gpointer data)
 	}
 	debug_print("Starting oauth2 listener thread\n");
 	oauth2_listener_cancel = 0;
-	pthread_create(&oauth2_listener_tid, NULL, prefs_account_oauth2_listener, (void*)win);
-	
+	int ret = pthread_create(&oauth2_listener_tid, NULL, prefs_account_oauth2_listener, (void*)win);
+        cm_return_if_fail(ret != 0);
 }
 
 static void prefs_account_oauth2_obtain_tokens(GtkButton *button, gpointer data)
@@ -6167,28 +6167,28 @@ static int prefs_account_oauth2_get_line(int sock, char *buf, int size)
 	char c = '\0';
 	int n;
 	
-	while ((i < size - 1) && (c != '\n'))
-	  {
-	    n = recv(sock, &c, 1, 0);
-	    //printf("%02X\n", c);
-	    if (n > 0)
-	      {
-		if (c == '\r')
-		  {
-		    n = recv(sock, &c, 1, MSG_PEEK);
-		    //printf("%02X\n", c);
-		    if ((n > 0) && (c == '\n'))
-		      recv(sock, &c, 1, 0);
-		    else
-		      c = '\n';
-		  }
-		buf[i] = c;
-		i++;
-	      }
-	    else
-	      c = '\n';
-	  }
-	buf[i] = '\0';
-	
-	return(i);
+	while ((i < size - 1) && (c != '\n')) {
+                n = recv(sock, &c, 1, 0);
+                //printf("%02X\n", c);
+                if (n > 0) {
+                        if (c == '\r') {
+                                n = recv(sock, &c, 1, MSG_PEEK);
+                                //printf("%02X\n", c);
+                                if ((n > 0) && (c == '\n')) {
+                                        n = recv(sock, &c, 1, 0);
+                                        if (n < 0)
+                                               log_message(LOG_PROTOCOL, "Receiving from pipe failed\n"); 
+                                }
+                                else
+                                        c = '\n';
+                        }
+                        buf[i] = c;
+                        i++;
+                }
+                else
+                        c = '\n';
+        }
+        buf[i] = '\0';
+
+        return (i);
 }

commit 30f5f9f83b22c007fe4bbe514f541505d240316d
Author: Michael Rasmussen <mir at datanom.net>
Date:   Sat May 21 10:03:12 2022 +0200

    fix CID 1504466
    
    Signed-off-by: Michael Rasmussen <mir at datanom.net>

diff --git a/src/prefs_account.c b/src/prefs_account.c
index 0f9446746..fc6db6afb 100644
--- a/src/prefs_account.c
+++ b/src/prefs_account.c
@@ -6024,7 +6024,7 @@ static void * prefs_account_oauth2_listener(void * param)
 	struct BasicProtocol *protocol_optmenu = (struct BasicProtocol *)oauth2_page.protocol_optmenu;
 	GtkWidget *optmenu = protocol_optmenu->combobox;
 	Oauth2Service service;
-        OAUTH2Data *OAUTH2Data = g_malloc(sizeof(* OAUTH2Data));
+        OAUTH2Data *OAUTH2Data = NULL;
 
 	
 	//pthread_detach(pthread_self());
@@ -6085,6 +6085,7 @@ static void * prefs_account_oauth2_listener(void * param)
 		  gtk_widget_set_sensitive(oauth2_page.oauth2_authcode_entry, FALSE);
 		  gtk_widget_set_sensitive(oauth2_page.oauth2_authorise_btn, FALSE);
 		  
+                  OAUTH2Data = g_malloc(sizeof(* OAUTH2Data));
 		  oauth2_init (OAUTH2Data);
 		  
 		  OAUTH2Data->custom_client_secret = 

-----------------------------------------------------------------------


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list