diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2012-06-29 21:49:35 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-07-09 02:51:11 -0400 |
commit | 12aba9e7974c5aabf0f4b8e90a5943bfa17fadf4 (patch) | |
tree | f28da1c51f0613c27bcd65ccf7f1208ae4fd5c25 /drivers/scsi/bnx2i | |
parent | 8f961faef791f6cc8fb1d10817fa7af3efcb544e (diff) |
bnx2i: use strlcpy() instead of memcpy() for strings
DRV_MODULE_VERSION here is "2.7.2.2" which is only 8 chars but we copy
12 bytes from the stack so it's a small information leak.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Michael Chan <mchan@broadcom.com>
Acked-by: Eddie Wai <eddie.wai@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/scsi/bnx2i')
-rw-r--r-- | drivers/scsi/bnx2i/bnx2i_init.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/scsi/bnx2i/bnx2i_init.c b/drivers/scsi/bnx2i/bnx2i_init.c index 7729a5223b33..b17637aab9a7 100644 --- a/drivers/scsi/bnx2i/bnx2i_init.c +++ b/drivers/scsi/bnx2i/bnx2i_init.c | |||
@@ -400,7 +400,7 @@ int bnx2i_get_stats(void *handle) | |||
400 | if (!stats) | 400 | if (!stats) |
401 | return -ENOMEM; | 401 | return -ENOMEM; |
402 | 402 | ||
403 | memcpy(stats->version, DRV_MODULE_VERSION, sizeof(stats->version)); | 403 | strlcpy(stats->version, DRV_MODULE_VERSION, sizeof(stats->version)); |
404 | memcpy(stats->mac_add1 + 2, hba->cnic->mac_addr, ETH_ALEN); | 404 | memcpy(stats->mac_add1 + 2, hba->cnic->mac_addr, ETH_ALEN); |
405 | 405 | ||
406 | stats->max_frame_size = hba->netdev->mtu; | 406 | stats->max_frame_size = hba->netdev->mtu; |