提交 72749a27 编写于 作者: D Dan Carpenter 提交者: Boaz Harrosh

exofs: Cap on the memcpy() size

This data comes from the device, so probably it's fairly trustworthy but
it makes the static checkers happy if we check it.

[Boaz]
  the system_id_len is zero, if not present, or always OSD_SYSTEMID_LEN.
  So always copy OSD_SYSTEMID_LEN bytes.
Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: NBoaz Harrosh <bharrosh@panasas.com>
上级 3e57638b
......@@ -529,7 +529,8 @@ static int exofs_devs_2_odi(struct exofs_dt_device_info *dt_dev,
struct osd_dev_info *odi)
{
odi->systemid_len = le32_to_cpu(dt_dev->systemid_len);
memcpy(odi->systemid, dt_dev->systemid, odi->systemid_len);
if (likely(odi->systemid_len))
memcpy(odi->systemid, dt_dev->systemid, OSD_SYSTEMID_LEN);
odi->osdname_len = le32_to_cpu(dt_dev->osdname_len);
odi->osdname = dt_dev->osdname;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册