Fix potential UB when target_file directory is null
authorStefan Granitz <stefan.graenitz@gmail.com>
Fri, 15 Feb 2019 16:42:29 +0000 (16:42 +0000)
committerStefan Granitz <stefan.graenitz@gmail.com>
Fri, 15 Feb 2019 16:42:29 +0000 (16:42 +0000)
commit42a9da7b355034159e61fdcbeea7c7efb5bff5ed
tree141070939a1fbe7f62dfa06cebc45188e68a95f8
parent8a2b543a133340377e8cc92ee8860d60ee93d80c
Fix potential UB when target_file directory is null

Summary: As seen in a crash report, the C-string returned for the directory component of `target_file` can null. It should not be assigned to `std::string` directly as this is undefined behavior.

Reviewers: jingham

Reviewed By: jingham

Subscribers: jdoerfert, lldb-commits, #lldb

Differential Revision: https://reviews.llvm.org/D57964

llvm-svn: 354145
lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp