summaryrefslogtreecommitdiff
path: root/exec
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2014-11-02 12:29:27 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2014-11-02 12:37:29 +0100
commit673603dae49fd06de782780a38e2914ed8cd8777 (patch)
tree2ec8dc979bf6e1c30a4d04a682bc90dd74192cd6 /exec
parent139b283e0d40a3a482a61e1fb9afb5381323d8d0 (diff)
Fix proc_getprocinfo calls
The procinfoCnt argument is the number of elements of the procinfo_t array, not its size in bytes. * exec/elfcore.c (dump_core): Fix procinfoCnt given to proc_getprocinfo. * libps/procstat.c (merge_procinfo): Likewise. * utils/login.c (check_owned): Likewise.
Diffstat (limited to 'exec')
-rw-r--r--exec/elfcore.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/exec/elfcore.c b/exec/elfcore.c
index 1f9238b6..033604c9 100644
--- a/exec/elfcore.c
+++ b/exec/elfcore.c
@@ -334,7 +334,7 @@ dump_core (task_t task, file_t file, off_t corelimit,
mach_msg_type_number_t num_waits = 0;
char pibuf[offsetof (struct procinfo, threadinfos[2])];
struct procinfo *pi = (void *) &pibuf;
- mach_msg_type_number_t pi_size = sizeof pibuf;
+ mach_msg_type_number_t pi_size = sizeof pibuf / sizeof(*(procinfo_t*)0);
memset (&pstatus.data, 0, sizeof pstatus.data);
memset (&psinfo.data, 0, sizeof psinfo.data);