Skip to content

Commit 7f90b86

Browse files
committed
FIX: segfault accessing null ptr from readline #172
1 parent 42c007e commit 7f90b86

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/omega/PythonInterpreter.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,11 @@ class PythonInteractiveThread: public Thread
9292
if(mccTarget == "") prompt = ostr("%1%>>", %sys->getApplication()->getName());
9393
else prompt = ostr("@%1%>>", %mccTarget);
9494
char *inp_c = readline(prompt.c_str()); //Instead of getline()
95-
95+
if(inp_c == NULL)
96+
{
97+
oerror("[PythonInteractiveThread] readline returned NULL");
98+
break;
99+
}
96100
// THE COMMAND OF DEATH
97101
if(inp_c[0] == 'D' &&
98102
inp_c[1] == 'I' &&

0 commit comments

Comments
 (0)