[Commits] [SCM] claws branch, master, updated. 3.17.0-4-g6406496

wwp at claws-mail.org wwp at claws-mail.org
Sat Aug 18 09:59:02 CEST 2018


The branch, master has been updated
       via  6406496b93866bb472a221ba93422fdb56c95773 (commit)
      from  e0a319b4b672c592f9824509d948914a4d167a1e (commit)

Summary of changes:
 src/account.c |   22 +++++++++++++++++-----
 1 file changed, 17 insertions(+), 5 deletions(-)


- Log -----------------------------------------------------------------
commit 6406496b93866bb472a221ba93422fdb56c95773
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;
 }

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


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list