Ticket #3116 (closed defect: fixed)

Opened 3 years ago

Last modified 3 years ago

fix various segfauls fixed in fedora

Reported by: eugenesan Owned by:
Priority: major Milestone: 4.8.12
Component: mc-core Version: master
Keywords: Cc:
Blocked By: Blocking:
Branch state: no branch Votes for changeset: committed-master

Description

Fix various segfauls by importing patches from Fedora

Attachments

fix-various-segfaults-fixed-in-fedora.patch (2.8 KB) - added by eugenesan 3 years ago.
fix various segfauls fixed in fedora

Change History

Changed 3 years ago by eugenesan

fix various segfauls fixed in fedora

comment:1 Changed 3 years ago by andrew_b

  • Blocked By 3113 added
  • Milestone changed from Future Releases to 4.8.12

comment:2 Changed 3 years ago by andrew_b

diff --git a/src/editor/editcmd.c b/src/editor/editcmd.c
index b726b85..e976def 100644
--- a/src/editor/editcmd.c
+++ b/src/editor/editcmd.c
@@ -3415,7 +3415,8 @@ edit_load_back_cmd (WEdit * edit)
         return FALSE;
 
     edit_stack_iterator--;
-    if (edit_history_moveto[edit_stack_iterator].filename_vpath != NULL)
+    if (edit_stack_iterator >= 0
+        && edit_history_moveto[edit_stack_iterator].filename_vpath != NULL)
         return edit_reload_line (edit, edit_history_moveto[edit_stack_iterator].filename_vpath,
                                  edit_history_moveto[edit_stack_iterator].line);
 

This patch seems incorrect. edit_stack iterator is unsigned. Therefore the condition edit_stack_iterator >= 0 is always true.

comment:3 Changed 3 years ago by andrew_b

  • Blocked By 3113 removed

comment:4 Changed 3 years ago by andrew_b

  • Status changed from new to closed
  • Votes for changeset set to committed-master
  • Resolution set to fixed
Note: See TracTickets for help on using tickets.