[Commits] [SCM] claws branch, master, updated. 3.16.0-172-g4eed7df

wwp at claws-mail.org wwp at claws-mail.org
Tue May 22 19:31:40 CEST 2018


The branch, master has been updated
       via  4eed7df3a7d38a2cced8397449a7367e98138ea9 (commit)
      from  817deab2f1f059caa306fcbc56af728f4a41716c (commit)

Summary of changes:
 src/common/utils.c                    |    5 +++--
 src/plugins/managesieve/sieve_prefs.c |    7 ++++---
 src/plugins/vcalendar/vcal_manager.c  |    5 +++--
 3 files changed, 10 insertions(+), 7 deletions(-)


- Log -----------------------------------------------------------------
commit 4eed7df3a7d38a2cced8397449a7367e98138ea9
Author: wwp <wwp at free.fr>
Date:   Tue May 22 19:30:08 2018 +0200

    Fix more unchecked return values reported by Coverity:
    1434282, 1434283, 1434284

diff --git a/src/common/utils.c b/src/common/utils.c
index 8236e84..6bb2d6f 100644
--- a/src/common/utils.c
+++ b/src/common/utils.c
@@ -3563,8 +3563,9 @@ static void _get_rfc822_date(gchar *buf, gint len, gboolean hidetz)
 	else
 		lt = localtime_r(&t, &buf1);
 
-	sscanf(asctime_r(lt, buf2), "%3s %3s %d %d:%d:%d %d\n",
-	       day, mon, &dd, &hh, &mm, &ss, &yyyy);
+	if (sscanf(asctime_r(lt, buf2), "%3s %3s %d %d:%d:%d %d\n",
+	       day, mon, &dd, &hh, &mm, &ss, &yyyy) != 7)
+		g_warning("failed reading date/time");
 
 	g_snprintf(buf, len, "%s, %d %s %d %02d:%02d:%02d %s",
 		   day, dd, mon, yyyy, hh, mm, ss, (hidetz? "-0000": tzoffset(&t)));
diff --git a/src/plugins/managesieve/sieve_prefs.c b/src/plugins/managesieve/sieve_prefs.c
index c005122..a26057e 100644
--- a/src/plugins/managesieve/sieve_prefs.c
+++ b/src/plugins/managesieve/sieve_prefs.c
@@ -507,9 +507,9 @@ struct SieveAccountConfig *sieve_prefs_account_get_config(
 	enc_userid[0] = '\0';
 	enc_passwd[0] = '\0';
 #if defined(G_OS_WIN32) || defined(__OpenBSD__) || defined(__FreeBSD__)
-	sscanf(confstr, "%c%c %255s %c%hu %hhu %hhu %hhu %255s %255s",
+	if (sscanf(confstr, "%c%c %255s %c%hu %hhu %hhu %hhu %255s %255s",
 #else
-	sscanf(confstr, "%c%c %ms %c%hu %hhu %hhu %hhu %255s %255s",
+	if (sscanf(confstr, "%c%c %ms %c%hu %hhu %hhu %hhu %255s %255s",
 #endif
 			&enable, &use_host,
 #if defined(G_OS_WIN32) || defined(__OpenBSD__) || defined(__FreeBSD__)
@@ -522,7 +522,8 @@ struct SieveAccountConfig *sieve_prefs_account_get_config(
 			&auth,
 			&auth_type,
 			enc_userid,
-			enc_passwd);
+			enc_passwd) != 10)
+		g_warning("failed reading Sieve config elements");
 
 	/* Scan enums separately, for endian purposes */
 	config->tls_type = tls_type;
diff --git a/src/plugins/vcalendar/vcal_manager.c b/src/plugins/vcalendar/vcal_manager.c
index 260ad83..52bfd81 100644
--- a/src/plugins/vcalendar/vcal_manager.c
+++ b/src/plugins/vcalendar/vcal_manager.c
@@ -529,8 +529,9 @@ static void get_rfc822_date_from_time_t(gchar *buf, gint len, time_t t)
 	struct tm buft2;
 
 	lt = localtime_r(&t, &buft2);
-	sscanf(asctime_r(lt, buft1), "%3s %3s %d %d:%d:%d %d\n",
-	       day, mon, &dd, &hh, &mm, &ss, &yyyy);
+	if (sscanf(asctime_r(lt, buft1), "%3s %3s %d %d:%d:%d %d\n",
+	       day, mon, &dd, &hh, &mm, &ss, &yyyy) != 7)
+		g_warning("failed reading date/time");
 	g_snprintf(buf, len, "%s, %d %s %d %02d:%02d:%02d %s",
 		   day, dd, mon, yyyy, hh, mm, ss, tzoffset(&t));
 #else

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


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list