[Commits] [SCM] claws branch, master, updated. 3.17.8-85-gdb3f1fad9
colin at claws-mail.org
colin at claws-mail.org
Mon May 24 11:41:55 CEST 2021
The branch, master has been updated
via db3f1fad9cd9c56e2c9a56b99a48a9742f0b31ce (commit)
via 237fbc4127b691d343cdb43fe71a2a0896dc693e (commit)
via 9dee8a09a7cda3f07ebdeefe8161f113dc7a2f42 (commit)
from ac286a71ed78429e16c612161251b9ea90ccd431 (commit)
Summary of changes:
src/common/utils.c | 8 +++++---
src/summaryview.c | 21 +++++++++++----------
2 files changed, 16 insertions(+), 13 deletions(-)
- Log -----------------------------------------------------------------
commit db3f1fad9cd9c56e2c9a56b99a48a9742f0b31ce
Author: Colin Leroy <colin at colino.net>
Date: Mon May 24 10:32:29 2021 +0200
Fix email detection on dnd with large headers
diff --git a/src/common/utils.c b/src/common/utils.c
index 19ef5ab88..e7b80ab50 100644
--- a/src/common/utils.c
+++ b/src/common/utils.c
@@ -4009,13 +4009,12 @@ gboolean file_is_email (const gchar *filename)
{
FILE *fp = NULL;
gchar buffer[2048];
- gint i = 0;
gint score = 0;
if (filename == NULL)
return FALSE;
if ((fp = claws_fopen(filename, "rb")) == NULL)
return FALSE;
- while (i < 60 && score < 3
+ while (score < 3
&& claws_fgets(buffer, sizeof (buffer), fp) != NULL) {
if (!strncmp(buffer, "From:", strlen("From:")))
score++;
@@ -4025,7 +4024,10 @@ gboolean file_is_email (const gchar *filename)
score++;
else if (!strncmp(buffer, "Subject:", strlen("Subject:")))
score++;
- i++;
+ else if (!strcmp(buffer, "\r\n")) {
+ debug_print("End of headers\n");
+ break;
+ }
}
claws_fclose(fp);
return (score >= 3);
commit 237fbc4127b691d343cdb43fe71a2a0896dc693e
Author: Colin Leroy <colin at colino.net>
Date: Mon May 24 10:31:44 2021 +0200
Fix possible double free
diff --git a/src/summaryview.c b/src/summaryview.c
index b2ae52423..1bbb43ca0 100644
--- a/src/summaryview.c
+++ b/src/summaryview.c
@@ -5066,10 +5066,11 @@ void summary_save_as(SummaryView *summaryview)
msginfo = gtk_cmctree_node_get_row_data(ctree, GTK_CMCTREE_NODE(item->data));
if (!msginfo) break;
src = procmsg_get_message_file(msginfo);
- if (append_file(src, dest, TRUE) < 0)
+ if (append_file(src, dest, TRUE) < 0) {
alertpanel_error(_("Couldn't save the file '%s'."), tmp);
+ }
+ g_free(src);
}
- g_free(src);
}
filedir = g_path_get_dirname(dest);
commit 9dee8a09a7cda3f07ebdeefe8161f113dc7a2f42
Author: Colin Leroy <colin at colino.net>
Date: Mon May 24 10:30:58 2021 +0200
Fix use after free
diff --git a/src/summaryview.c b/src/summaryview.c
index cb0d768c9..b2ae52423 100644
--- a/src/summaryview.c
+++ b/src/summaryview.c
@@ -5015,18 +5015,18 @@ void summary_save_as(SummaryView *summaryview)
manage_window_focus_in(summaryview->window, NULL, NULL);
if (filename && !g_utf8_validate(filename, -1, NULL)) {
- gchar *oldstr = filename;
- filename = conv_codeset_strdup(filename,
+ gchar *converted_filename = conv_codeset_strdup(filename,
conv_get_locale_charset_str(),
CS_UTF_8);
- if (!filename) {
+ if (!converted_filename) {
g_warning("summary_save_as(): failed to convert character set.");
- filename = g_strdup(oldstr);
+ } else {
+ g_free(filename);
+ filename = converted_filename;
}
- dest = filename;
- g_free(filename);
- } else
- dest = filename;
+ }
+
+ dest = filename;
filename = NULL;
if (!dest) return;
if (prefs_common.attach_save_dir && *prefs_common.attach_save_dir)
-----------------------------------------------------------------------
hooks/post-receive
--
Claws Mail
More information about the Commits
mailing list