HomePhabricator

Fix potential UB when target_file directory is null

Authored by sgraenitz on Feb 15 2019, 8:42 AM.

Description

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