diff options
Diffstat (limited to 'www/chromium/files/patch-base_process_process__handle__freebsd.cc')
| -rw-r--r-- | www/chromium/files/patch-base_process_process__handle__freebsd.cc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/www/chromium/files/patch-base_process_process__handle__freebsd.cc b/www/chromium/files/patch-base_process_process__handle__freebsd.cc index 5cc930471cea..1e055cdbfd37 100644 --- a/www/chromium/files/patch-base_process_process__handle__freebsd.cc +++ b/www/chromium/files/patch-base_process_process__handle__freebsd.cc @@ -1,4 +1,4 @@ ---- base/process/process_handle_freebsd.cc.orig 2022-04-21 18:48:31 UTC +--- base/process/process_handle_freebsd.cc.orig 2025-02-19 07:43:18 UTC +++ base/process/process_handle_freebsd.cc @@ -3,6 +3,7 @@ // found in the LICENSE file. @@ -8,18 +8,18 @@ #include <limits.h> #include <stddef.h> -@@ -15,10 +16,13 @@ namespace base { +@@ -20,10 +21,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 }; + int mib[] = {CTL_KERN, KERN_PROC, KERN_PROC_PID, process}; - if (sysctl(mib, std::size(mib), &info, &length, NULL, 0) < 0) + if (sysctl(mib, std::size(mib), &info, &length, NULL, 0) < 0) { + return -1; + + if (length < sizeof(struct kinfo_proc)) return -1; + } - return info.ki_ppid; |
