[Commits] [SCM] claws branch, master, updated. 3.10.0-74-g61c0a7f

Colin colin at claws-mail.org
Sun Jun 8 09:55:57 CEST 2014


The branch master of project "claws" (Claws Mail) has been updated
       via  61c0a7f00292ecc66f53021e7e9490f52a885094 (commit)
       via  4b91074c994cababf7c574d67b1bc96bbdf94346 (commit)
       via  fef490583f394d87ae0f56893307c5c56ae3e3fb (commit)
      from  bee3bbd649888f8b8b52b1b4d9da472edd0b63a2 (commit)


- Log -----------------------------------------------------------------
commit 61c0a7f00292ecc66f53021e7e9490f52a885094
Author: Colin Leroy <colin at colino.net>
Date:   Sun Jun 8 09:55:41 2014 +0200

    Fix another double-close

diff --git a/src/plugins/clamd/libclamd/clamd-plugin.c b/src/plugins/clamd/libclamd/clamd-plugin.c
index b11554d..80bf1e9 100644
--- a/src/plugins/clamd/libclamd/clamd-plugin.c
+++ b/src/plugins/clamd/libclamd/clamd-plugin.c
@@ -509,7 +509,6 @@ Clamd_Stat clamd_verify_email(const gchar* path, response* result) {
 			result->msg = g_strdup(tmp);
 			g_free(tmp);
 			debug_print("result: %s\n", result->msg);
-			close(sock);
 			return stat;
 		}
 		debug_print("copy to buf: %s\n", tmp);

commit 4b91074c994cababf7c574d67b1bc96bbdf94346
Author: Colin Leroy <colin at colino.net>
Date:   Sat Jun 7 22:34:27 2014 +0200

    Coverity fixes

diff --git a/src/plugins/smime/smime.c b/src/plugins/smime/smime.c
index 4657045..e3970b6 100644
--- a/src/plugins/smime/smime.c
+++ b/src/plugins/smime/smime.c
@@ -65,13 +65,19 @@ static gint smime_check_signature(MimeInfo *mimeinfo);
 static PrivacyDataPGP *smime_new_privacydata()
 {
 	PrivacyDataPGP *data;
+	gpgme_ctx_t 	ctx;
+
+	if (gpgme_new(&ctx) != GPG_ERR_NO_ERROR) {
+		debug_print("gpgme_new failed");
+		return NULL;
+	}
 
 	data = g_new0(PrivacyDataPGP, 1);
 	data->data.system = &smime_system;
 	data->done_sigtest = FALSE;
 	data->is_signed = FALSE;
 	data->sigstatus = NULL;
-	gpgme_new(&data->ctx);
+	data->ctx = ctx;
 	
 	return data;
 }
@@ -103,6 +109,8 @@ static gboolean smime_is_signed(MimeInfo *mimeinfo)
 		if (tmpstr && !g_ascii_strcasecmp(tmpstr, "signed-data")) {
 			if (data == NULL) {
 				data = smime_new_privacydata();
+				if (!data)
+					return FALSE;
 				mimeinfo->privacy = (PrivacyData *) data;
 			}
 
@@ -144,6 +152,8 @@ static gboolean smime_is_signed(MimeInfo *mimeinfo)
 
 	if (data == NULL) {
 		data = smime_new_privacydata();
+		if (!data)
+			return FALSE;
 		mimeinfo->privacy = (PrivacyData *) data;
 	}
 	
@@ -196,12 +206,21 @@ static gint smime_check_signature(MimeInfo *mimeinfo)
 	const gchar *tmpstr;
 	gpgme_data_t sigdata = NULL, textdata = NULL;
 	gpgme_error_t err;
+	EncodingType oldenc = ENC_BINARY;
+
 	cm_return_val_if_fail(mimeinfo != NULL, -1);
 	cm_return_val_if_fail(mimeinfo->privacy != NULL, -1);
+
 	data = (PrivacyDataPGP *) mimeinfo->privacy;
-	gpgme_new(&data->ctx);
-	EncodingType oldenc = ENC_BINARY;
-	
+
+	if (!data->ctx) {
+		if ((err = gpgme_new(&data->ctx)) != GPG_ERR_NO_ERROR) {
+			debug_print("gpgme_new failed: %s\n",
+				gpgme_strerror(err));
+			return -1;
+		}
+	}
+
 	debug_print("Checking S/MIME signature\n");
 
 	err = gpgme_set_protocol(data->ctx, GPGME_PROTOCOL_CMS);
@@ -296,6 +315,7 @@ static gint smime_check_signature(MimeInfo *mimeinfo)
 				g_node_prepend(parentinfo->node, decinfo->node);
 				return 0;
 			} else {
+				g_free(textstr);
 				return -1;
 			}
 		}
@@ -495,6 +515,10 @@ static MimeInfo *smime_decrypt(MimeInfo *mimeinfo)
 			data = (PrivacyDataPGP *) decinfo->privacy;
 		} else {
 			data = smime_new_privacydata();
+			if (!data) {
+				gpgme_release(ctx);
+				return NULL;
+			}
 			decinfo->privacy = (PrivacyData *) data;	
 		}
 		data->done_sigtest = TRUE;
@@ -711,15 +735,18 @@ gboolean smime_encrypt(MimeInfo *mimeinfo, const gchar *encrypt_data)
 	while (fprs[i] && strlen(fprs[i])) {
 		i++;
 	}
-	
-	gpgme_new(&ctx);
+
+	if ((err = gpgme_new(&ctx)) != GPG_ERR_NO_ERROR) {
+		debug_print ("gpgme_new failed: %s\n", gpgme_strerror(err));
+		return FALSE;
+	}
 
 	err = gpgme_set_protocol(ctx, GPGME_PROTOCOL_CMS);
 
 	if (err) {
 		debug_print ("gpgme_set_protocol failed: %s\n",
                    gpgme_strerror (err));
-		return FALSE;   
+		return FALSE;
 	}
 
 	kset = g_malloc(sizeof(gpgme_key_t)*(i+1));
@@ -823,6 +850,7 @@ gboolean smime_encrypt(MimeInfo *mimeinfo, const gchar *encrypt_data)
 	} else {
 		perror("get_tmp_file");
 		g_free(tmpfile);
+		g_free(enccontent);
 		return FALSE;
 	}
 	gpgme_data_release(gpgtext);

commit fef490583f394d87ae0f56893307c5c56ae3e3fb
Author: Colin Leroy <colin at colino.net>
Date:   Sat Jun 7 22:23:40 2014 +0200

    More Coverity fixes

diff --git a/src/plugins/pdf_viewer/poppler_viewer.c b/src/plugins/pdf_viewer/poppler_viewer.c
index cccc08b..8120237 100644
--- a/src/plugins/pdf_viewer/poppler_viewer.c
+++ b/src/plugins/pdf_viewer/poppler_viewer.c
@@ -1347,14 +1347,17 @@ static void pdf_viewer_update(MimeViewer *_viewer, gboolean reload_file, int pag
 		main_window_cursor_normal(mainwindow_get_mainwindow());
 	} 
 	if (viewer->pdf_doc == NULL) {
-		strretchomp(error->message);
 		stock_pixbuf_gdk(viewer->hbox, 
 				STOCK_PIXMAP_MIME_APPLICATION, 
 				&viewer->icon_pixbuf);
 
 		gtk_image_set_from_pixbuf(GTK_IMAGE(viewer->icon_type), viewer->icon_pixbuf);
-		alertpanel_error("%s", error->message);
-
+		if (error) {
+			strretchomp(error->message);
+			alertpanel_error("%s", error->message);
+		} else {
+			alertpanel_error(_("PDF rendering failed for an unknown reason."));
+		}
 		pdf_viewer_show_controls(viewer, FALSE);
 		g_error_free(error);
 		return;
@@ -1436,8 +1439,10 @@ static void pdf_viewer_show_mimepart(MimeViewer *_viewer, const gchar *infile,
 	viewer->rotate = 0;
 	viewer->to_load = partinfo;
 
+	if (messageview)
+		messageview->updating = TRUE;
+
 	memset(buf, 0, sizeof(buf));
-	messageview->updating = TRUE;
 	debug_print("pdf_viewer_show_mimepart\n");
 
 	if (viewer->filename != NULL) {
@@ -1456,13 +1461,11 @@ static void pdf_viewer_show_mimepart(MimeViewer *_viewer, const gchar *infile,
 
 	if (partinfo && !(procmime_get_part(viewer->filename, partinfo) < 0)) {
 
-		if (_viewer && _viewer->mimeview && 
-				_viewer->mimeview->messageview->forced_charset) {
+		if (messageview && messageview->forced_charset)
 			charset = _viewer->mimeview->messageview->forced_charset;
-		}
-		else {
+		else
 			charset = procmime_mimeinfo_get_parameter(partinfo, "charset");
-		}
+
 		if (charset == NULL) {
 			charset = conv_get_locale_charset_str();
 		}

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

Summary of changes:
 src/plugins/clamd/libclamd/clamd-plugin.c |    1 -
 src/plugins/pdf_viewer/poppler_viewer.c   |   21 ++++++++-------
 src/plugins/smime/smime.c                 |   42 ++++++++++++++++++++++++-----
 3 files changed, 47 insertions(+), 17 deletions(-)


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list