Skip to content

Commit

Permalink
fix interactive Corba crash
Browse files Browse the repository at this point in the history
- guard SystemImpl__directoryExists for NULL string
- guard CorbaImpl__initialize agains NULL corbaObjectReferenceFilePath
  • Loading branch information
adrpo authored and OpenModelica-Hudson committed Jan 27, 2017
1 parent aef3898 commit 610eb70
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Compiler/runtime/corbaimpl.cpp
Expand Up @@ -226,7 +226,7 @@ Please stop or kill the other OMC process first!\nOpenModelica OMC will now exit
/* get the temporary directory */
/* if corbaObjectReferenceFilePath value is set and is a valid directory then use it for dumping the object reference file. */
const char* tempPath = NULL;
if (SystemImpl__directoryExists(corbaObjectReferenceFilePath))
if (!corbaObjectReferenceFilePath && SystemImpl__directoryExists(corbaObjectReferenceFilePath))
tempPath = corbaObjectReferenceFilePath;
else
tempPath = SettingsImpl__getTempDirectoryPath();
Expand Down
2 changes: 2 additions & 0 deletions Compiler/runtime/systemimpl.c
Expand Up @@ -851,6 +851,8 @@ extern double SystemImpl__time(void)

extern int SystemImpl__directoryExists(const char *str)
{
/* if the string is NULL return 0 */
if (!str) return 0;
#if defined(__MINGW32__) || defined(_MSC_VER)
WIN32_FIND_DATA FileData;
HANDLE sh;
Expand Down

0 comments on commit 610eb70

Please sign in to comment.