[Commits] [SCM] claws branch, master, updated. 4.2.0-1-gca7335445

paul at claws-mail.org paul at claws-mail.org
Tue Nov 21 11:40:22 UTC 2023


The branch, master has been updated
       via  ca7335445eedf0da1b6518846338a7abdecbb7e1 (commit)
      from  2573f543f6fea2532847112928aa77d8e66d5b5d (commit)

Summary of changes:
 src/mimeview.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)


- Log -----------------------------------------------------------------
commit ca7335445eedf0da1b6518846338a7abdecbb7e1
Author: Paul <paul at claws-mail.org>
Date:   Tue Nov 21 11:40:17 2023 +0000

    if cmd is invalid, NULL it
    
    this prevents an execution attempt of an invalid command, and also prevents spewing text content into the debug output, and also prevents it being necessary to hit the Cancel button twice on the 'Open with...' dialogue

diff --git a/src/mimeview.c b/src/mimeview.c
index 5b5f6e6fc..6c1b853f2 100644
--- a/src/mimeview.c
+++ b/src/mimeview.c
@@ -2265,9 +2265,10 @@ static void mimeview_view_file(const gchar *filename, MimeInfo *partinfo,
 				g_chmod(filename, S_IRUSR|S_IWUSR);
  		} else {
 			g_warning("MIME viewer command-line is invalid: '%s'", cmd);
+			cmd = NULL;
 			mimeview_open_part_with(mimeview, partinfo, FALSE);
  		}
-		if (execute_command_line(buf, TRUE, NULL) != 0) {
+		if (cmd != NULL && execute_command_line(buf, TRUE, NULL) != 0) {
 			if (!prefs_common.save_parts_readwrite)
 				g_chmod(filename, S_IRUSR|S_IWUSR);
 			mimeview_open_part_with(mimeview, partinfo, FALSE);

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


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list