From: Jacob Adams Date: Wed, 18 Mar 2015 13:04:01 +0000 (-0400) Subject: swifi: Fix incorrect memset X-Git-Url: http://zhaoyanbai.com/repos/man.rndc-confgen.html?a=commitdiff_plain;h=80c94e3974cbcd299b63d7c9910dfda7e1cce373;p=minix.git swifi: Fix incorrect memset Change-Id: I6764aff558f51cdb90b91a3e71c982e8b3f47058 --- diff --git a/minix/commands/swifi/systest.c b/minix/commands/swifi/systest.c index 66277c748..e0a7234dd 100644 --- a/minix/commands/swifi/systest.c +++ b/minix/commands/swifi/systest.c @@ -66,14 +66,14 @@ main(int argc, char * argv[]) goto Usage; } } - - res = malloc(arg * sizeof(swifi_result_t)); + size_t ressize = arg * sizeof(swifi_result_t); + res = malloc(ressize); if (res == NULL) { printf("Out of memory\n"); goto Cleanup; } - memset(res, 0, sizeof(res)); + memset(res, 0, ressize); /* // Find out where the faults will be injected