Skip to content

Commit

Permalink
zero array before using it
Browse files Browse the repository at this point in the history
  • Loading branch information
yellowman committed Jun 3, 2016
1 parent df6a5f4 commit 5718a22
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions stats.c
Expand Up @@ -783,6 +783,8 @@ mbpr(void)
int page_size = getpagesize();
int nmbtypes = sizeof(mbstat.m_mtypes) / sizeof(short);

memset(&seen, 0, sizeof(seen));

if (nmbtypes != 256) {
printf("%% mbpr: unexpected change to mbstat; check source\n");
return;
Expand Down

0 comments on commit 5718a22

Please sign in to comment.