mirror of
https://github.com/torvalds/linux.git
synced 2026-06-07 22:14:04 +02:00
staging: most: core: replace strcpy() by strscpy()
[ Upstream commit3970d0d818] The strcpy() function is being deprecated. Replace it by the safer strscpy() and fix the following Coverity warning: "You might overrun the 80-character fixed-size string iface->p->name by copying iface->description without checking the length." Addresses-Coverity-ID: 1444760 ("Copy into fixed size buffer") Fixes:131ac62253("staging: most: core: use device description as name") Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
4e160b91c7
commit
472592bb5f
|
|
@ -1412,7 +1412,7 @@ int most_register_interface(struct most_interface *iface)
|
|||
|
||||
INIT_LIST_HEAD(&iface->p->channel_list);
|
||||
iface->p->dev_id = id;
|
||||
strcpy(iface->p->name, iface->description);
|
||||
strscpy(iface->p->name, iface->description, sizeof(iface->p->name));
|
||||
iface->dev.init_name = iface->p->name;
|
||||
iface->dev.bus = &mc.bus;
|
||||
iface->dev.parent = &mc.dev;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user