diff --git a/python.cpp b/python.cpp index b55b020..3182f2d 100644 --- a/python.cpp +++ b/python.cpp @@ -290,6 +290,9 @@ static bool return_python_result(idc_value_t *rv, char *errbuf, size_t errbufsize) { + if (errbufsize > 0) + errbuf[0] = '\0'; + if (result == NULL) { handle_python_error(errbuf, errbufsize); @@ -326,6 +329,7 @@ static bool return_python_result(idc_value_t *rv, return true; } + qsnprintf(errbuf, errbufsize, "ERROR: bad return value"); return false; } @@ -706,6 +710,14 @@ void idaapi run(int arg) IDAPython_ScriptBox(); break; ;; + case 3: + enable_extlang_python(true); + break; + ;; + case 4: + enable_extlang_python(false); + break; + ;; default: warning("IDAPython: unknown plugin argument %d", arg); break;