From 6bf52dcc8db01c453a7a3875c0806e8390f194ec Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Mon, 22 Mar 2021 15:44:55 +0100 Subject: [PATCH] startup: do not crash when trying to open a device or directory Make sure there is an 'openfile' record before trying to save an error message in this record. This fixes https://savannah.gnu.org/bugs/?60268. Bug existed since commit ede64d7e from yesterday. --- src/winio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/winio.c b/src/winio.c index 83d129c0..0f770ebe 100644 --- a/src/winio.c +++ b/src/winio.c @@ -2230,7 +2230,7 @@ void statusline(message_type importance, const char *msg, ...) va_end(ap); #ifdef ENABLE_MULTIBUFFER - if (!we_are_running && importance == ALERT && + if (!we_are_running && importance == ALERT && openfile && !openfile->errormessage && openfile->next != openfile) openfile->errormessage = copy_of(compound); #endif