mirror of
https://git.freebsd.org/ports.git
synced 2025-06-20 12:10:31 -04:00
- Make existing patches apply cleanly Changelog: https://chromium.googlesource.com/chromium/src/+log/72.0.3626.121..73.0.3683.86?pretty=fuller&n=10000 Submitted by: Matthias Wolf MFH: 2019Q2
17 lines
535 B
C++
17 lines
535 B
C++
--- base/process/process_handle_freebsd.cc.orig 2019-03-11 22:00:51 UTC
|
|
+++ base/process/process_handle_freebsd.cc
|
|
@@ -16,10 +16,13 @@ namespace base {
|
|
|
|
ProcessId GetParentProcessId(ProcessHandle process) {
|
|
struct kinfo_proc info;
|
|
- size_t length;
|
|
+ size_t length = sizeof(struct kinfo_proc);
|
|
int mib[] = { CTL_KERN, KERN_PROC, KERN_PROC_PID, process };
|
|
|
|
if (sysctl(mib, base::size(mib), &info, &length, NULL, 0) < 0)
|
|
+ return -1;
|
|
+
|
|
+ if (length < sizeof(struct kinfo_proc))
|
|
return -1;
|
|
|
|
return info.ki_ppid;
|