id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	blockedby	blocking	branch_state	votes
4650	Segfault after pressing Shift+F4	linnando	andrew_b	"Actions to reproduce: press Shift+F4 (reproducibility may depend on the config; I got it on a freshly built instance, but I am not sure which config it pulled).

Expected result: open an editor window.

Actual result: segfault.

The segfault happens at https://github.com/MidnightCommander/mc/blob/5cae1ddd9a4dc80ace53d02da6843401eaeb4e7c/src/execute.c#L311 because argv is dereferenced unconditionally, even though https://github.com/MidnightCommander/mc/blob/5cae1ddd9a4dc80ace53d02da6843401eaeb4e7c/src/execute.c#L664 passes NULL as argv when parsing external_cmd_options fails.

A possible patch is here: https://github.com/linnando/mc/tree/fix-shiftf4-segfault

Output of mc -V:

GNU Midnight Commander 4.8.31
Built with GLib 2.82.1
Built with S-Lang 2.3.3 with terminfo database
Built with libssh2 1.11.0
With builtin Editor and Aspell support
With subshell support as default
With support for background operations
With mouse support on xterm and Linux console
With support for X11 events
With internationalization support
With multiple codepages support
With ext2fs attributes support
Virtual File Systems:
 cpiofs, tarfs, sfs, extfs, ext2undelfs, ftpfs, sftpfs, shell
Data types:
 char: 8; int: 32; long: 64; void *: 64; size_t: 64; off_t: 64;"	defect	closed	major	4.8.34	mcedit	4.8.33	fixed					merged	committed-master
