mirror of
https://github.com/intel/llvm.git
synced 2026-01-21 12:19:23 +08:00
Fix use after free, found by Benjamin Kramer.
llvm-svn: 72333
This commit is contained in:
@@ -79,12 +79,12 @@ DarwinHostInfo::DarwinHostInfo(const Driver &D, const llvm::Triple& Triple)
|
||||
|
||||
assert(memcmp(&getOSName()[0], "darwin", 6) == 0 &&
|
||||
"Unknown Darwin platform.");
|
||||
const char *Release = &getOSName()[6];
|
||||
bool HadExtra;
|
||||
if (!Driver::GetReleaseVersion(Release, DarwinVersion[0], DarwinVersion[1],
|
||||
if (!Driver::GetReleaseVersion(&getOSName()[6],
|
||||
DarwinVersion[0], DarwinVersion[1],
|
||||
DarwinVersion[2], HadExtra)) {
|
||||
D.Diag(clang::diag::err_drv_invalid_darwin_version)
|
||||
<< Release;
|
||||
<< getOSName();
|
||||
}
|
||||
|
||||
// We can only call 4.2.1 for now.
|
||||
|
||||
Reference in New Issue
Block a user