From fb54f37b54712f16fe70bbd4f9c40b56e0d4e6c4 Mon Sep 17 00:00:00 2001 From: maurycy <5383+maurycy@users.noreply.github.com> Date: Wed, 19 Aug 2026 18:59:11 +0200 Subject: [PATCH] actual /= sizeof(pid_t); --- Modules/_remote_debugging/subprocess.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Modules/_remote_debugging/subprocess.c b/Modules/_remote_debugging/subprocess.c index cdad75e318be914..056cc6773a88b44 100644 --- a/Modules/_remote_debugging/subprocess.c +++ b/Modules/_remote_debugging/subprocess.c @@ -307,6 +307,7 @@ get_child_pids_platform(pid_t target_pid, int recursive, pid_array_t *result) PyErr_SetString(PyExc_OSError, "Failed to get process count"); goto done; } + n_pids /= sizeof(pid_t); /* Allocate buffer for PIDs (add some slack for new processes) */ int buffer_size = n_pids + 64; @@ -322,6 +323,7 @@ get_child_pids_platform(pid_t target_pid, int recursive, pid_array_t *result) PyErr_SetString(PyExc_OSError, "Failed to list PIDs"); goto done; } + actual /= sizeof(pid_t); /* Build pid -> ppid mapping */ ppids = (pid_t *)PyMem_Malloc(actual * sizeof(pid_t));