[cfe-commits] r72333 - /cfe/trunk/lib/Driver/HostInfo.cpp
Daniel Dunbar
daniel at zuster.org
Sat May 23 11:55:59 PDT 2009
Author: ddunbar
Date: Sat May 23 13:55:58 2009
New Revision: 72333
URL: http://llvm.org/viewvc/llvm-project?rev=72333&view=rev
Log:
Fix use after free, found by Benjamin Kramer.
Modified:
cfe/trunk/lib/Driver/HostInfo.cpp
Modified: cfe/trunk/lib/Driver/HostInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/HostInfo.cpp?rev=72333&r1=72332&r2=72333&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/HostInfo.cpp (original)
+++ cfe/trunk/lib/Driver/HostInfo.cpp Sat May 23 13:55:58 2009
@@ -79,12 +79,12 @@
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.
More information about the cfe-commits
mailing list