From 6679bc15ca89c8693cdf78b32bde07b435cd40cb Mon Sep 17 00:00:00 2001 From: Jonas Devlieghere Date: Thu, 20 Dec 2018 23:45:26 +0000 Subject: [PATCH] Fix stack-buffer-overflow in lldb_private::Host::FindProcesses Found by the address sanitizer on GreenDragon: http://green.lab.llvm.org/green/view/LLDB/job/lldb-sanitized/1628/console llvm-svn: 349858 --- lldb/source/Host/macosx/objcxx/Host.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lldb/source/Host/macosx/objcxx/Host.mm b/lldb/source/Host/macosx/objcxx/Host.mm index 18f2a53e5657..45798e68036b 100644 --- a/lldb/source/Host/macosx/objcxx/Host.mm +++ b/lldb/source/Host/macosx/objcxx/Host.mm @@ -627,7 +627,7 @@ uint32_t Host::FindProcesses(const ProcessInstanceInfoMatch &match_info, int mib[3] = {CTL_KERN, KERN_PROC, KERN_PROC_ALL}; size_t pid_data_size = 0; - if (::sysctl(mib, 4, NULL, &pid_data_size, NULL, 0) != 0) + if (::sysctl(mib, 3, NULL, &pid_data_size, NULL, 0) != 0) return 0; // Add a few extra in case a few more show up