提交 8c6deb9c 编写于 作者: R Roel Kluin 提交者: Dmitry Torokhov

Input: i8042 - fix incorrect usage of strncpy and strncat

Fix incorrect length argument for strncpy and strncat by replacing them with
strlcpy and strlcat
Signed-off-by: NRoel Kluin <12o3l@tiscali.nl>
Signed-off-by: NDmitry Torokhov <dtor@mail.ru>
上级 d0478d0a
......@@ -370,10 +370,10 @@ static int i8042_pnp_kbd_probe(struct pnp_dev *dev, const struct pnp_device_id *
if (pnp_irq_valid(dev,0))
i8042_pnp_kbd_irq = pnp_irq(dev, 0);
strncpy(i8042_pnp_kbd_name, did->id, sizeof(i8042_pnp_kbd_name));
strlcpy(i8042_pnp_kbd_name, did->id, sizeof(i8042_pnp_kbd_name));
if (strlen(pnp_dev_name(dev))) {
strncat(i8042_pnp_kbd_name, ":", sizeof(i8042_pnp_kbd_name));
strncat(i8042_pnp_kbd_name, pnp_dev_name(dev), sizeof(i8042_pnp_kbd_name));
strlcat(i8042_pnp_kbd_name, ":", sizeof(i8042_pnp_kbd_name));
strlcat(i8042_pnp_kbd_name, pnp_dev_name(dev), sizeof(i8042_pnp_kbd_name));
}
i8042_pnp_kbd_devices++;
......@@ -391,10 +391,10 @@ static int i8042_pnp_aux_probe(struct pnp_dev *dev, const struct pnp_device_id *
if (pnp_irq_valid(dev, 0))
i8042_pnp_aux_irq = pnp_irq(dev, 0);
strncpy(i8042_pnp_aux_name, did->id, sizeof(i8042_pnp_aux_name));
strlcpy(i8042_pnp_aux_name, did->id, sizeof(i8042_pnp_aux_name));
if (strlen(pnp_dev_name(dev))) {
strncat(i8042_pnp_aux_name, ":", sizeof(i8042_pnp_aux_name));
strncat(i8042_pnp_aux_name, pnp_dev_name(dev), sizeof(i8042_pnp_aux_name));
strlcat(i8042_pnp_aux_name, ":", sizeof(i8042_pnp_aux_name));
strlcat(i8042_pnp_aux_name, pnp_dev_name(dev), sizeof(i8042_pnp_aux_name));
}
i8042_pnp_aux_devices++;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册