mc/src
Andreas Mohr e1ad66e90e Ticket #3605: extfs: fix buffer overflow.
When handling with copy/move commands inside of archive we can lead into buffer overflow
steps to roproduce:
    create simple 7z archive
    open it
    rename single filename
    hit buffer overflow

found by clang/AddressSanitizer

==17794==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x602000273593 at pc 0x00000045f2a9 bp 0x7ffc94aa8e20 sp 0x7ffc94aa85d0
READ of size 2 at 0x602000273593 thread T0
    #0 0x45f2a8 in __interceptor_strchr.part.44 (/usr/bin/mc+0x45f2a8)
    #1 0x70fb72 in extfs_find_entry_int /tmp/portage/app-misc/mc-9999/work/mc-9999/src/vfs/extfs/extfs.c:312:13
    #2 0x70f562 in extfs_find_entry /tmp/portage/app-misc/mc-9999/work/mc-9999/src/vfs/extfs/extfs.c:331:11
    #3 0x712131 in extfs_internal_stat /tmp/portage/app-misc/mc-9999/work/mc-9999/src/vfs/extfs/extfs.c:1117:13
    #4 0x7f3de308ab59 in mc_stat /tmp/portage/app-misc/mc-9999/work/mc-9999/lib/vfs/interface.c:556:46
    #5 0x538575 in file_mask_dialog /tmp/portage/app-misc/mc-9999/work/mc-9999/src/filemanager/filegui.c:1340:25
    #6 0x6e0753 in panel_operate /tmp/portage/app-misc/mc-9999/work/mc-9999/src/filemanager/file.c:2718:13
    #7 0x6bdabd in rename_cmd /tmp/portage/app-misc/mc-9999/work/mc-9999/src/filemanager/cmd.c:811:9
    #8 0x551ef4 in midnight_execute_cmd /tmp/portage/app-misc/mc-9999/work/mc-9999/src/filemanager/midnight.c:1307:9
    #9 0x7f3de30a49e7 in buttonbar_callback /tmp/portage/app-misc/mc-9999/work/mc-9999/lib/widget/buttonbar.c:172:42
    #10 0x7f3de30b2305 in dlg_try_hotkey /tmp/portage/app-misc/mc-9999/work/mc-9999/lib/widget/dialog.c:464:23
    #11 0x7f3de30b199a in dlg_key_event /tmp/portage/app-misc/mc-9999/work/mc-9999/lib/widget/dialog.c:509:19
    #12 0x7f3de30b2ef9 in frontend_dlg_run /tmp/portage/app-misc/mc-9999/work/mc-9999/lib/widget/dialog.c:570:9
    #13 0x7f3de30b2af5 in dlg_run /tmp/portage/app-misc/mc-9999/work/mc-9999/lib/widget/dialog.c:1267:5
    #14 0x5507bb in do_nc /tmp/portage/app-misc/mc-9999/work/mc-9999/src/filemanager/midnight.c:1827:9
    #15 0x50b874 in main /tmp/portage/app-misc/mc-9999/work/mc-9999/src/main.c:403:21
    #16 0x7f3de1ec78fb in __libc_start_main (/lib64/libc.so.6+0x208fb)
    #17 0x427f48 in _start (/usr/bin/mc+0x427f48)

Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-03-20 11:54:52 +03:00
..
consaver Update copyright years. 2016-01-01 11:48:10 +03:00
diffviewer Ticket #3566: Split MSG_ACTION into MSG_ACTION and MSG_NOTIFY. 2016-03-12 14:49:39 +03:00
editor Split MSG_ACTION into MSG_ACTION and MSG_NOTIFY. 2016-03-12 14:49:40 +03:00
filemanager Split MSG_ACTION into MSG_ACTION and MSG_NOTIFY. 2016-03-12 14:49:40 +03:00
man2hlp Ticket 1551: Update GPL version from 2 to 3 2011-10-18 14:08:34 +03:00
subshell Clarify AM_CPPFLAGS. 2016-03-04 09:23:36 +03:00
vfs Ticket #3605: extfs: fix buffer overflow. 2016-03-20 11:54:52 +03:00
viewer Ticket #3566: Split MSG_ACTION into MSG_ACTION and MSG_NOTIFY. 2016-03-12 14:49:39 +03:00
.gitignore Ticket 1551: Update GPL version from 2 to 3 2011-10-18 14:08:34 +03:00
args.c Cleanup: args.c: recude function scope for mcedit_arg_*. 2016-03-04 09:23:37 +03:00
args.h Cleanup: args.c: recude function scope for mcedit_arg_*. 2016-03-04 09:23:37 +03:00
background.c Remove unneeded struct keyword for typedef'd structs 2016-03-04 09:23:38 +03:00
background.h Remove unneeded struct keyword for typedef'd structs 2016-03-04 09:23:38 +03:00
clipboard.c Update copyright years. 2016-01-01 11:48:10 +03:00
clipboard.h Use events for operate with clipboard (copy/paste to external clipboard, save/load to file) 2011-03-21 23:55:52 +02:00
cons.handler.c Update copyright years. 2016-01-01 11:48:10 +03:00
events_init.c Update copyright years. 2016-01-01 11:48:10 +03:00
events_init.h Prepare to initialize application events. 2011-03-21 11:46:41 +02:00
execute.c Update copyright years. 2016-01-01 11:48:10 +03:00
execute.h Remove unused function exec_shell(). 2016-01-01 11:48:09 +03:00
help.c Ticket #3566: Split MSG_ACTION into MSG_ACTION and MSG_NOTIFY. 2016-03-12 14:49:39 +03:00
help.h Typo fixes. 2013-07-23 14:15:24 +04:00
history.h fixed doxygen documentation 2012-09-10 14:29:53 +03:00
keybind-defaults.c Update copyright years. 2016-01-01 11:48:10 +03:00
keybind-defaults.h Ticket #2576: fix of symbols duplication. 2011-07-14 21:46:59 +04:00
learn.c Update copyright years. 2016-01-01 11:48:10 +03:00
learn.h Code indentation in src directory 2010-11-24 10:27:47 +03:00
main.c Clarify macro variables for USE_INTERNAL_EDIT. 2016-03-04 09:23:36 +03:00
Makefile.am Clarify AM_CPPFLAGS. 2016-03-04 09:23:36 +03:00
selcodepage.c Update copyright years. 2016-01-01 11:48:10 +03:00
selcodepage.h Cleanup of main.[ch]. 2010-11-24 10:51:31 +03:00
setup.c Cleanup: setup.c: reduce function scope. 2016-03-04 09:23:36 +03:00
setup.h Cleanup: setup.c: reduce function scope. 2016-03-04 09:23:36 +03:00
textconf.c Update copyright years. 2016-01-01 11:48:10 +03:00
textconf.h Added --configure-options for easy update & reconfigure existing mc. 2011-03-29 12:37:55 +03:00
util.c Update copyright years. 2016-01-01 11:48:10 +03:00
util.h (check_for_default): minor optimization and change return value. 2012-04-22 11:25:11 +03:00