]> git.openfabrics.org - ~adrianc/mstflint.git/commitdiff
Fix a (harmless) buffer overrun
authorOren Kladnitsky <orenk@dev.mellanox.co.il>
Thu, 27 Oct 2011 14:34:47 +0000 (16:34 +0200)
committerOren Kladnitsky <orenk@dev.mellanox.co.il>
Thu, 27 Oct 2011 14:34:47 +0000 (16:34 +0200)
mflash.c

index dbcf7c3044e9a0f9730d1ed00186898be30a65bf..864a8f14500ec8f409e887f6799b40a13e2f35f1 100644 (file)
--- a/mflash.c
+++ b/mflash.c
@@ -3227,7 +3227,7 @@ typedef struct mf_cmd_if {
 } mf_cmd_if_t;
 
 static void cmd_if_pack(mf_cmd_if_t* cmd, u_int32_t* buf) {
-    memset((char*)buf, 0, sizeof(mf_cmd_if_t));
+    memset((char*)buf, 0, CMD_IF_SIZE);
     buf[0] = EXTRACT64(cmd->in_param, 32, 32);
     buf[1] = EXTRACT64(cmd->in_param,  0, 32);
     buf[2] = cmd->input_modifier;