forked from OSchip/llvm-project
Fix use after free, found by Benjamin Kramer.
llvm-svn: 72333
This commit is contained in:
parent
c1fca9fb3a
commit
b8fb96905d
|
@ -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.
|
||||
|
|
Loading…
Reference in New Issue