[Commits] [SCM] claws branch, master, updated. 3.14.0-29-g6298f43

ticho at claws-mail.org ticho at claws-mail.org
Wed Aug 24 13:59:17 CEST 2016


The branch, master has been updated
       via  6298f434d40a5becd305eb3dba447b4888ef8327 (commit)
       via  61b7a029bb2089eeb80e3bafbf944266c6a6c046 (commit)
      from  a22303ce00367add653f0b87d8e2d301bb15e9f9 (commit)

Summary of changes:
 src/gtk/gtkutils.h  |   12 +++++++-----
 src/prefs_account.c |   29 +++++++++++++++++++++--------
 2 files changed, 28 insertions(+), 13 deletions(-)


- Log -----------------------------------------------------------------
commit 6298f434d40a5becd305eb3dba447b4888ef8327
Author: Andrej Kacian <ticho at claws-mail.org>
Date:   Wed Aug 24 13:52:23 2016 +0200

    Handle password loading more safely in prefs_account.c
    
    Inspired by patch in bug #3678.

diff --git a/src/prefs_account.c b/src/prefs_account.c
index 416c56a..250a173 100644
--- a/src/prefs_account.c
+++ b/src/prefs_account.c
@@ -1359,8 +1359,11 @@ static void basic_create_widget_func(PrefsPage * _page,
 		/* Passwords are handled outside of PrefParams. */
 		buf = passwd_store_get_account(ac_prefs->account_id,
 				PWS_ACCOUNT_RECV);
-		gtk_entry_set_text(GTK_ENTRY(page->pass_entry), buf);
-		g_free(buf);
+		gtk_entry_set_text(GTK_ENTRY(page->pass_entry), buf != NULL ? buf : "");
+		if (buf != NULL) {
+			memset(buf, 0, strlen(buf));
+			g_free(buf);
+		}
 	}
 
 	page->vbox = vbox1;
@@ -1896,8 +1899,11 @@ static void send_create_widget_func(PrefsPage * _page,
 		/* Passwords are handled outside of PrefParams. */
 		buf = passwd_store_get_account(ac_prefs->account_id,
 				PWS_ACCOUNT_SEND);
-		gtk_entry_set_text(GTK_ENTRY(page->smtp_pass_entry), buf);
-		g_free(buf);
+		gtk_entry_set_text(GTK_ENTRY(page->smtp_pass_entry), buf != NULL ? buf : "");
+		if (buf != NULL) {
+			memset(buf, 0, strlen(buf));
+			g_free(buf);
+		}
 	}
 
 	pop_bfr_smtp_tm_set_sens (NULL, NULL);
@@ -2624,12 +2630,19 @@ static void ssl_create_widget_func(PrefsPage * _page,
 		/* Passwords are handled outside of PrefParams. */
 		buf = passwd_store_get_account(ac_prefs->account_id,
 				PWS_ACCOUNT_RECV_CERT);
-		gtk_entry_set_text(GTK_ENTRY(page->entry_in_cert_pass), buf);
-		g_free(buf);
+		gtk_entry_set_text(GTK_ENTRY(page->entry_in_cert_pass), buf != NULL ? buf : "");
+		if (buf != NULL) {
+			memset(buf, 0, strlen(buf));
+			g_free(buf);
+		}
+
 		buf = passwd_store_get_account(ac_prefs->account_id,
 				PWS_ACCOUNT_SEND_CERT);
-		gtk_entry_set_text(GTK_ENTRY(page->entry_out_cert_pass), buf);
-		g_free(buf);
+		gtk_entry_set_text(GTK_ENTRY(page->entry_out_cert_pass), buf != NULL ? buf : "");
+		if (buf != NULL) {
+			memset(buf, 0, strlen(buf));
+			g_free(buf);
+		}
 	}
 
 	page->vbox = vbox1;

commit 61b7a029bb2089eeb80e3bafbf944266c6a6c046
Author: Andrej Kacian <ticho at claws-mail.org>
Date:   Wed Aug 24 13:39:33 2016 +0200

    Do a basic check for widget validity in CLAWS_SET_TIP().
    
    Inspired by patch in bug #3678.

diff --git a/src/gtk/gtkutils.h b/src/gtk/gtkutils.h
index 7510387..568e334 100644
--- a/src/gtk/gtkutils.h
+++ b/src/gtk/gtkutils.h
@@ -202,11 +202,13 @@ claws_input_add    (gint	      source,
 		    gpointer	      data,
 		    gboolean          is_sock);
 
-#define CLAWS_SET_TIP(widget,tip) { 					\
-	if (tip != NULL)						\
-		gtk_widget_set_tooltip_text(GTK_WIDGET(widget), tip); 	\
-	else								\
-		gtk_widget_set_has_tooltip(GTK_WIDGET(widget), FALSE);	\
+#define CLAWS_SET_TIP(widget,tip) { 						\
+	if (widget != NULL) {							\
+		if (tip != NULL)						\
+			gtk_widget_set_tooltip_text(GTK_WIDGET(widget), tip); 	\
+		else								\
+			gtk_widget_set_has_tooltip(GTK_WIDGET(widget), FALSE);	\
+	}									\
 }
 
 #if (defined USE_GNUTLS && GLIB_CHECK_VERSION(2,22,0))

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


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list