Properly zero memory where appropriate (bug 14401, bug 14403)

This commit is contained in:
rim
2018-05-26 23:40:11 +02:00
committed by Landry Breuil
parent fa797de140
commit 2329f243fb
6 changed files with 12 additions and 5 deletions

View File

@@ -122,6 +122,7 @@ get_task_details (kvm_t *kd, struct kinfo_proc *kp, Task *task)
char **argv;
int i;
bzero(task, sizeof(Task));
task->pid = kp->ki_pid;
task->ppid = kp->ki_ppid;
task->cpu_user = 100 * ((double)kp->ki_pctcpu / FSCALE);
@@ -213,7 +214,7 @@ get_task_list (GArray *task_list)
{
kvm_t *kd;
struct kinfo_proc *kp;
int cnt, i;
int cnt = 0, i;
Task task;
if ((kd = kvm_openfiles (_PATH_DEVNULL, _PATH_DEVNULL, NULL, O_RDONLY, NULL)) == NULL)