Skip to content
This repository was archived by the owner on May 18, 2019. It is now read-only.

Commit 610eb70

Browse files
adrpoOpenModelica-Hudson
authored andcommitted
fix interactive Corba crash
- guard SystemImpl__directoryExists for NULL string - guard CorbaImpl__initialize agains NULL corbaObjectReferenceFilePath
1 parent aef3898 commit 610eb70

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

Compiler/runtime/corbaimpl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ Please stop or kill the other OMC process first!\nOpenModelica OMC will now exit
226226
/* get the temporary directory */
227227
/* if corbaObjectReferenceFilePath value is set and is a valid directory then use it for dumping the object reference file. */
228228
const char* tempPath = NULL;
229-
if (SystemImpl__directoryExists(corbaObjectReferenceFilePath))
229+
if (!corbaObjectReferenceFilePath && SystemImpl__directoryExists(corbaObjectReferenceFilePath))
230230
tempPath = corbaObjectReferenceFilePath;
231231
else
232232
tempPath = SettingsImpl__getTempDirectoryPath();

Compiler/runtime/systemimpl.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -851,6 +851,8 @@ extern double SystemImpl__time(void)
851851

852852
extern int SystemImpl__directoryExists(const char *str)
853853
{
854+
/* if the string is NULL return 0 */
855+
if (!str) return 0;
854856
#if defined(__MINGW32__) || defined(_MSC_VER)
855857
WIN32_FIND_DATA FileData;
856858
HANDLE sh;

0 commit comments

Comments
 (0)