+ fix security issue (do not run uncontrolled format string)

This commit is contained in:
wmayer 2014-08-06 10:16:06 +02:00
parent 46583f2960
commit 0c2d201396

View File

@ -851,16 +851,16 @@ PyObject* Application::sDoCommand(PyObject * /*self*/, PyObject *args,PyObject *
PyObject* Application::sDoCommandGui(PyObject * /*self*/, PyObject *args,PyObject * /*kwd*/)
{
char *pstr=0;
if (!PyArg_ParseTuple(args, "s", &pstr)) // convert args: Python->C
if (!PyArg_ParseTuple(args, "s", &pstr)) // convert args: Python->C
return NULL; // NULL triggers exception
Command::doCommand(Command::Gui,pstr);
Command::runCommand(Command::Gui,pstr);
return Py_None;
}
PyObject* Application::sAddModule(PyObject * /*self*/, PyObject *args,PyObject * /*kwd*/)
{
char *pstr=0;
if (!PyArg_ParseTuple(args, "s", &pstr)) // convert args: Python->C
if (!PyArg_ParseTuple(args, "s", &pstr)) // convert args: Python->C
return NULL; // NULL triggers exception
Command::addModule(Command::Doc,pstr);
return Py_None;