summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp
diff options
context:
space:
mode:
authorAdrian Prantl <aprantl@apple.com>2019-04-29 17:28:38 +0000
committerAdrian Prantl <aprantl@apple.com>2019-04-29 17:28:38 +0000
commita93e77c1c711ce19199e404d8e61e649384bd711 (patch)
treef2296baf2fe9804268827d5f48999eaa37c9f7b3 /lldb/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp
parent250eae24528d1f10299a8cb35591e5b3899cefec (diff)
downloadbcm5719-llvm-a93e77c1c711ce19199e404d8e61e649384bd711.tar.gz
bcm5719-llvm-a93e77c1c711ce19199e404d8e61e649384bd711.zip
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 llvm-svn: 359471
Diffstat (limited to 'lldb/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp')
-rw-r--r--lldb/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp b/lldb/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp
index 8edcb8e0470..47b7b9f77eb 100644
--- a/lldb/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp
+++ b/lldb/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp
@@ -164,7 +164,7 @@ ConstString PlatformMacOSX::GetSDKDirectory(lldb_private::Target &target) {
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;
OpenPOWER on IntegriCloud