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
This commit is contained in:
Adrian Prantl 2019-04-29 17:28:38 +00:00
parent 250eae2452
commit a93e77c1c7
1 changed files with 1 additions and 1 deletions

View File

@ -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;