From b1f4f32b363085b1cf0a3ab278a695aa99b5ddba Mon Sep 17 00:00:00 2001 From: Holger Vogt Date: Mon, 18 Aug 2025 23:49:53 +0200 Subject: [PATCH] Prevent a segfault if cp_variablesubst return a nullptr. Fixes bug-801 --- src/frontend/control.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/frontend/control.c b/src/frontend/control.c index 5c724ec12..9c982ef23 100644 --- a/src/frontend/control.c +++ b/src/frontend/control.c @@ -147,6 +147,10 @@ docommand(wordlist *wlist) /* Do all the things that used to be done by cshpar when the line * was read... */ wlist = cp_variablesubst(wlist); + + if (!wlist || !wlist->wl_word) + return; + pwlist(wlist, "After variable substitution"); wlist = cp_bquote(wlist);