From 80c94e3974cbcd299b63d7c9910dfda7e1cce373 Mon Sep 17 00:00:00 2001 From: Jacob Adams Date: Wed, 18 Mar 2015 09:04:01 -0400 Subject: [PATCH] swifi: Fix incorrect memset Change-Id: I6764aff558f51cdb90b91a3e71c982e8b3f47058 --- minix/commands/swifi/systest.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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