[Lldb-commits] [lldb] r349858 - Fix stack-buffer-overflow in lldb_private::Host::FindProcesses

Jonas Devlieghere via lldb-commits lldb-commits at lists.llvm.org
Thu Dec 20 15:45:26 PST 2018


Author: jdevlieghere
Date: Thu Dec 20 15:45:26 2018
New Revision: 349858

URL: http://llvm.org/viewvc/llvm-project?rev=349858&view=rev
Log:
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

Modified:
    lldb/trunk/source/Host/macosx/objcxx/Host.mm

Modified: lldb/trunk/source/Host/macosx/objcxx/Host.mm
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/macosx/objcxx/Host.mm?rev=349858&r1=349857&r2=349858&view=diff
==============================================================================
--- lldb/trunk/source/Host/macosx/objcxx/Host.mm (original)
+++ lldb/trunk/source/Host/macosx/objcxx/Host.mm Thu Dec 20 15:45:26 2018
@@ -627,7 +627,7 @@ uint32_t Host::FindProcesses(const Proce
   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




More information about the lldb-commits mailing list