From a698156d4dfe338da9d06eb35913bdf1565ee3b1 Mon Sep 17 00:00:00 2001 From: Stas Degteff Date: Tue, 22 Feb 2011 16:18:21 +0000 Subject: [PATCH] Check parameters of ShellToDos() and Unpack(). Bugreport from Semen Panevin 2:5025/121 --- golded3/geedit2.cpp | 4 +++- golded3/geread2.cpp | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/golded3/geedit2.cpp b/golded3/geedit2.cpp index 67864b5..2f203a1 100644 --- a/golded3/geedit2.cpp +++ b/golded3/geedit2.cpp @@ -1369,7 +1369,9 @@ void IEclass::DosShell() { GFTRK("EditDosShell"); - ShellToDos(getenv(GOLD_SHELL_ENV), LNG->DOS_Shell, LGREY_|_BLACK, YES); + char * shell = getenv(GOLD_SHELL_ENV); + if( shell && *shell ) + ShellToDos(shell, LNG->DOS_Shell, LGREY_|_BLACK, YES); cursoron(); cursoroff(); diff --git a/golded3/geread2.cpp b/golded3/geread2.cpp index 3ea12fe..cd5d691 100644 --- a/golded3/geread2.cpp +++ b/golded3/geread2.cpp @@ -511,7 +511,9 @@ void NewArea(bool jumpnext) { void DosShell() { - ShellToDos(getenv(GOLD_SHELL_ENV), LNG->DOS_Shell, LGREY_|_BLACK, YES); + char * shell = getenv(GOLD_SHELL_ENV); + if( shell && *shell ) + ShellToDos(shell, LNG->DOS_Shell, LGREY_|_BLACK, YES); }