sgraenitz updated this revision to Diff 186002.
sgraenitz added a comment.
Remove useless newline
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D57964/new/
https://reviews.llvm.org/D57964
Files:
source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
Index: source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
===================================================================
--- source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
+++ source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
@@ -2780,7 +2780,13 @@
basename = pathname; // not a filename, probably a package of some sort,
// let it go through
} else if (is_directory(st) || is_regular_file(st)) {
- std::string directory = target_file.GetDirectory().GetCString();
+ const char *dir_cstr = target_file.GetDirectory().GetCString();
+ if (!dir_cstr) {
+ error.SetErrorString("invalid directory name");
+ return false;
+ }
+
+ std::string directory(dir_cstr);
replace_all(directory, "\\", "\\\\");
replace_all(directory, "'", "\\'");
Index: source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
===================================================================
--- source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
+++ source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
@@ -2780,7 +2780,13 @@
basename = pathname; // not a filename, probably a package of some sort,
// let it go through
} else if (is_directory(st) || is_regular_file(st)) {
- std::string directory = target_file.GetDirectory().GetCString();
+ const char *dir_cstr = target_file.GetDirectory().GetCString();
+ if (!dir_cstr) {
+ error.SetErrorString("invalid directory name");
+ return false;
+ }
+
+ std::string directory(dir_cstr);
replace_all(directory, "\\", "\\\\");
replace_all(directory, "'", "\\'");
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits