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

@@ -50,6 +50,7 @@ get_cpu_usage (gushort *cpu_count, gfloat *cpu_user, gfloat *cpu_system)
static gboolean
get_task_details (guint pid, Task *task)
{
bzero(task, sizeof(Task));
g_snprintf (task->name, sizeof(task->name), "foo");
g_snprintf (task->cmdline, sizeof(task->cmdline), "foo -bar");
g_snprintf (task->uid_name, sizeof(task->uid_name), "baz");
@@ -61,7 +62,7 @@ gboolean
get_task_list (GArray *task_list)
{
guint pid = 0;
Task task = { 0 };
Task task;
//while (/* read all PIDs */)
{