[Lldb-commits] [lldb] r359471 - Fix a stack-smasher in PlatformMacOSX::GetSDKDirectory()
Adrian Prantl via lldb-commits
lldb-commits at lists.llvm.org
Mon Apr 29 10:28:38 PDT 2019
Author: adrian
Date: Mon Apr 29 10:28:38 2019
New Revision: 359471
URL: http://llvm.org/viewvc/llvm-project?rev=359471&view=rev
Log:
Fix a stack-smasher in PlatformMacOSX::GetSDKDirectory()
GetSDKVersion expects the number of version fields not their byte size
and will happily overwrite later contents of the stack.
Differential Revision: https://reviews.llvm.org/D61218
Modified:
lldb/trunk/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp
Modified: lldb/trunk/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp?rev=359471&r1=359470&r2=359471&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp (original)
+++ lldb/trunk/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp Mon Apr 29 10:28:38 2019
@@ -164,7 +164,7 @@ ConstString PlatformMacOSX::GetSDKDirect
std::string default_xcode_sdk;
FileSpec fspec;
uint32_t versions[2];
- if (objfile->GetSDKVersion(versions, sizeof(versions))) {
+ if (objfile->GetSDKVersion(versions, 2)) {
fspec = HostInfo::GetShlibDir();
if (fspec) {
std::string path;
More information about the lldb-commits
mailing list