提交 12aba9e7 编写于 作者: D Dan Carpenter 提交者: David S. Miller

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: NDan Carpenter <dan.carpenter@oracle.com>
Acked-by: NMichael Chan <mchan@broadcom.com>
Acked-by: NEddie Wai <eddie.wai@broadcom.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 8f961fae
......@@ -400,7 +400,7 @@ int bnx2i_get_stats(void *handle)
if (!stats)
return -ENOMEM;
memcpy(stats->version, DRV_MODULE_VERSION, sizeof(stats->version));
strlcpy(stats->version, DRV_MODULE_VERSION, sizeof(stats->version));
memcpy(stats->mac_add1 + 2, hba->cnic->mac_addr, ETH_ALEN);
stats->max_frame_size = hba->netdev->mtu;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册