Hi

If you start an editor with no filename ("mc -e") and press F11, it 
crashes on NULL pointer dereference. This patch fixes the crash.

Mikulas

Index: mc-4.8.6-test/src/filemanager/usermenu.c
===================================================================
--- mc-4.8.6-test.orig/src/filemanager/usermenu.c
+++ mc-4.8.6-test/src/filemanager/usermenu.c
@@ -243,8 +243,13 @@ test_condition (WEdit * edit_widget, cha
                 char *edit_filename;
 
                 edit_filename = edit_get_file_name (edit_widget);
-                *condition = mc_search (arg, edit_filename, search_type) ? 1 : 
0;
-                g_free (edit_filename);
+                if (edit_filename)
+                {
+                    *condition = mc_search (arg, edit_filename, search_type) ? 
1 : 0;
+                    g_free (edit_filename);
+                }
+                else
+                    *condition = 0;
             }
             else
 #endif
_______________________________________________
mc-devel mailing list
https://mail.gnome.org/mailman/listinfo/mc-devel

Reply via email to