diff options
Diffstat (limited to 'lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp')
-rw-r--r-- | lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp index 93497f13d7d..d1cd3ae5681 100644 --- a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp +++ b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp @@ -2781,6 +2781,11 @@ bool ScriptInterpreterPython::LoadScriptingModule( basename = pathname; // not a filename, probably a package of some sort, // let it go through } else if (is_directory(st) || is_regular_file(st)) { + if (target_file.GetDirectory().IsEmpty()) { + error.SetErrorString("invalid directory name"); + return false; + } + std::string directory = target_file.GetDirectory().GetCString(); replace_all(directory, "\\", "\\\\"); replace_all(directory, "'", "\\'"); |