[llvm] r359001 - [dsymutil] Fix use-after-free when sys::path::append grows the buffer.
Adrian Prantl via llvm-commits
llvm-commits at lists.llvm.org
Tue Apr 23 08:39:14 PDT 2019
Author: adrian
Date: Tue Apr 23 08:39:13 2019
New Revision: 359001
URL: http://llvm.org/viewvc/llvm-project?rev=359001&view=rev
Log:
[dsymutil] Fix use-after-free when sys::path::append grows the buffer.
<rdar://problem/50117620>
Modified:
llvm/trunk/tools/dsymutil/dsymutil.cpp
Modified: llvm/trunk/tools/dsymutil/dsymutil.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/dsymutil/dsymutil.cpp?rev=359001&r1=359000&r2=359001&view=diff
==============================================================================
--- llvm/trunk/tools/dsymutil/dsymutil.cpp (original)
+++ llvm/trunk/tools/dsymutil/dsymutil.cpp Tue Apr 23 08:39:13 2019
@@ -328,7 +328,7 @@ static Expected<OutputLocation> getOutpu
return std::move(E);
llvm::sys::path::append(Path, "Contents", "Resources");
- StringRef ResourceDir = Path;
+ std::string ResourceDir = Path;
llvm::sys::path::append(Path, "DWARF", llvm::sys::path::filename(DwarfFile));
return OutputLocation(Path.str(), ResourceDir.str());
}
More information about the llvm-commits
mailing list