mac: Work around broken {CTL_KERN, KERN_PROCARGS2} sysctl in 11.0db6

A new bug in macOS 11.0db6 20A5364e has broken the {CTL_KERN,
KERN_PROCARGS2} sysctl such that it will not work properly unless
provided with a buffer at least 17 bytes larger than originally
indicated. Work around the bug by providing a buffer a whole 32 bytes
larger.

Bug: crashpad:347, crashpad:355
Test: crashpad_util_test ProcessInfo.{Self,SelfTask,Forked}
Change-Id: I0fb0a10e23107875e740d7863842aef41018bff5
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2399646
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Commit-Queue: Mark Mentovai <mark@chromium.org>
GitOrigin-RevId: fc97e5cbb21dc7f4d4679b86792dd2717818bd80
diff --git a/util/posix/process_info_mac.cc b/util/posix/process_info_mac.cc
index 9e86e08..672e427 100644
--- a/util/posix/process_info_mac.cc
+++ b/util/posix/process_info_mac.cc
@@ -175,7 +175,14 @@
       return false;
     }
 
-    args_size = args_size_estimate + 1;
+    // TODO(https://crashpad.chromium.org/bug/355): This was increased from + 1
+    // to + 32 to work around a new bug in macOS 11.0db6 20A5364e that has
+    // broken {CTL_KERN, KERN_PROCARGS2} such that it will not work properly
+    // unless provided with a buffer at least 17 bytes larger than indicated in
+    // args_size_estimate. If this bug is fixed prior to the 11.0 release,
+    // remove the workaround and go back to + 1. (A positive offset is needed
+    // for the reasons described above.)
+    args_size = args_size_estimate + 32;
     args.resize(args_size);
     rv = sysctl(mib, base::size(mib), &args[0], &args_size, nullptr, 0);
     if (rv != 0) {