[Commits] [SCM] claws branch, 3.17.1-cherrypick, created. 3.17.0-2-gc80e87b

claws at claws-mail.org claws at claws-mail.org
Sun Aug 26 13:15:05 CEST 2018


The branch, 3.17.1-cherrypick has been created
        at  c80e87b11ef9f00dce76135f58aeafdf85a56f0c (commit)

- Log -----------------------------------------------------------------
commit c80e87b11ef9f00dce76135f58aeafdf85a56f0c
Author: wwp <subscript at free.fr>
Date:   Sat Aug 18 09:56:41 2018 +0200

    Warn and fail rather than miserably crashing when format string in
    faulty.

diff --git a/src/account.c b/src/account.c
index cf28983..e73a012 100644
--- a/src/account.c
+++ b/src/account.c
@@ -1977,8 +1977,14 @@ gboolean account_signatures_matchlist_str_found(const gchar *str, const gchar *f
 		 item != NULL && !found;
 		 item = g_slist_next(item)) {
 		tmp = g_strdup_printf(format, (gchar *)item->data);
-		found = (strcmp(tmp, str) == 0);
-		g_free(tmp);
+		if (tmp) {
+			found = (strcmp(tmp, str) == 0);
+			g_free(tmp);
+		} else {
+			g_warning("account_signatures_matchlist_str_found: g_strdup_printf failed, check format '%s'",
+				format);
+			return FALSE;
+		}
 	}
 	return found;
 }
@@ -1995,9 +2001,15 @@ gboolean account_signatures_matchlist_nchar_found(const gchar *str, const gchar
 		 item != NULL && !found;
 		 item = g_slist_next(item)) {
 		tmp = g_strdup_printf(format, (gchar *)item->data);
-		len = strlen(tmp);
-		found = (strncmp(tmp, str, len) == 0);
-		g_free(tmp);
+		if (tmp) {
+			len = strlen(tmp);
+			found = (strncmp(tmp, str, len) == 0);
+			g_free(tmp);
+		} else {
+			g_warning("account_signatures_matchlist_nchar_found: g_strdup_printf failed, check format '%s'",
+				format);
+			return FALSE;
+		}
 	}
 	return found;
 }

commit 4281111b7a2f883d87260251065f621b0f107dfb
Author: wwp <subscript at free.fr>
Date:   Sat Aug 18 09:34:09 2018 +0200

    Fix for Bug 4072: Crash when clicking 'reply' or 'reply with quote'
    Wrong '%\n' format causes a crash in g_strdup_printf.

diff --git a/src/quote_fmt_parse.y b/src/quote_fmt_parse.y
index 03c872a..92e300e 100644
--- a/src/quote_fmt_parse.y
+++ b/src/quote_fmt_parse.y
@@ -491,7 +491,7 @@ static void quote_fmt_show_msg(MsgInfo *msginfo, const gchar *body,
 		while (fgets(buf, sizeof(buf), fp) != NULL) {
 			strcrchomp(buf);
 
-			if (!signature && account_signatures_matchlist_nchar_found(buf, "%\n"))
+			if (!signature && account_signatures_matchlist_nchar_found(buf, "%s\n"))
 				break;
 		
 			if (quoted && quote_str)

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


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list