فهرست منبع

kamcmd: proper size for memset, based on malloc

(cherry picked from commit 7134959725011baa504a027c4561e0054dd907ae)
(cherry picked from commit a768ffa5a083bbddc35db59b2686046c000c0482)
Daniel-Constantin Mierla 11 سال پیش
والد
کامیت
a2bd0750c5
1فایلهای تغییر یافته به همراه1 افزوده شده و 1 حذف شده
  1. 1 1
      utils/sercmd/sercmd.c

+ 1 - 1
utils/sercmd/sercmd.c

@@ -1499,7 +1499,7 @@ static int get_mi_list(int s)
 	/* alloc the mi_cmds array */
 	mi_cmds=malloc(mi_which_results*sizeof(*mi_cmds));
 	if (mi_cmds==0) goto error_mem;
-	memset(mi_cmds, 0, mi_which_results* sizeof(mi_cmds));
+	memset(mi_cmds, 0, mi_which_results* sizeof(*mi_cmds));
 	/* get the mi names list */
 	for (r=0; r<mi_which_no; r++){
 		if (mi_which_array[r].type!=BINRPC_T_STR)