[Commits] [SCM] claws branch, master, updated. 3.16.0-258-gd8525e5

wwp at claws-mail.org wwp at claws-mail.org
Mon Aug 13 12:55:58 CEST 2018


The branch, master has been updated
       via  d8525e5d8d71ac89fb0db7e7a2a0a1dae6a8cf51 (commit)
      from  95583f605d6964ed71bf6a35e658229ef609e9da (commit)

Summary of changes:
 src/summaryview.c |   19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)


- Log -----------------------------------------------------------------
commit d8525e5d8d71ac89fb0db7e7a2a0a1dae6a8cf51
Author: wwp <wwp at free.fr>
Date:   Mon Aug 13 12:54:08 2018 +0200

    Fix buffer clash (one already present, one added in 3.16.0-254-gb9c4e27),
    leading to broken To value in From column of message list.

diff --git a/src/summaryview.c b/src/summaryview.c
index 306972c..d6f179e 100644
--- a/src/summaryview.c
+++ b/src/summaryview.c
@@ -3364,7 +3364,8 @@ static inline void summary_set_header(SummaryView *summaryview, gchar *text[],
 {
 	static gchar date_modified[80];
 	static gchar col_score[11];
-	static gchar buf[BUFFSIZE], tmp1[BUFFSIZE], tmp2[BUFFSIZE], tmp3[BUFFSIZE];
+	static gchar from_buf[BUFFSIZE], to_buf[BUFFSIZE];
+	static gchar tmp1[BUFFSIZE], tmp2[BUFFSIZE], tmp3[BUFFSIZE];
 	gint *col_pos = summaryview->col_pos;
 	gchar *from_text = NULL, *to_text = NULL, *tags_text = NULL;
 	gboolean should_swap = FALSE;
@@ -3454,9 +3455,9 @@ static inline void summary_set_header(SummaryView *summaryview, gchar *text[],
 	} else {
 		gchar *tmp = summary_complete_address(msginfo->from);
 		if (tmp) {
-			strncpy2(buf, tmp, sizeof(buf));
+			strncpy2(from_buf, tmp, sizeof(from_buf));
 			g_free(tmp);
-			from_text = buf;
+			from_text = from_buf;
 		} else {
 			if (prefs_common.summary_from_show == SHOW_NAME)
 				from_text = msginfo->fromname;
@@ -3484,11 +3485,11 @@ static inline void summary_set_header(SummaryView *summaryview, gchar *text[],
 		if (prefs_common.summary_from_show == SHOW_NAME) {
 			gchar *tmp = procheader_get_fromname(to_text);
 			/* need to keep to_text pointing to stack, so heap-allocated
-			 * string from procheader_get_fromname() will be copied to buf */
+			 * string from procheader_get_fromname() will be copied to to_buf */
 			if (tmp != NULL) {
-				strncpy2(buf, tmp, sizeof(buf));
+				strncpy2(to_buf, tmp, sizeof(to_buf));
 				g_free(tmp);
-				to_text = buf;
+				to_text = to_buf;
 			}
 		} else if (prefs_common.summary_from_show == SHOW_ADDR)
 			extract_address(to_text);
@@ -3501,11 +3502,11 @@ static inline void summary_set_header(SummaryView *summaryview, gchar *text[],
 		if (prefs_common.use_addr_book) {
 			gchar *tmp = summary_complete_address(to_text);
 			/* need to keep to_text pointing to stack, so heap-allocated
-			 * string from summary_complete_address() will be copied to buf */
+			 * string from summary_complete_address() will be copied to to_buf */
 			if (tmp) {
-				strncpy2(buf, tmp, sizeof(buf));
+				strncpy2(to_buf, tmp, sizeof(to_buf));
 				g_free(tmp);
-				to_text = buf;
+				to_text = to_buf;
 			} else {
 				to_text = to_text ? to_text : _("(No From)");
 			}

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


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list