Ticket #4213: workaround to avoid crash on FreeBSD.

In the read_subshell_prompt() (src/subshell/common.c:1546) the first
call of select() returns 0. Therefore subshell_prompt is NULL.
NULL dereference is the cause of crash.

This commit isn't a real fix but just a workaround.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
Andrew Borodin 2021-06-06 17:09:25 +03:00
parent b870f16b0d
commit 443a8106f1

View File

@ -978,6 +978,10 @@ setup_cmdline (void)
return;
#ifdef ENABLE_SUBSHELL
/* Workaround: avoid crash on FreeBSD (see ticket #4213 for details) */
if (subshell_prompt == NULL)
return;
if (mc_global.tty.use_subshell)
{
tmp_prompt = g_string_free (subshell_prompt, FALSE);