diff options
author | Gustavo A. R. Silva <gustavo@embeddedor.com> | 2019-04-22 10:40:38 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-04-25 12:04:48 +0200 |
commit | 3970d0d81816310175b6272e709ee09dd3e05171 (patch) | |
tree | ec0fd5a4f62798892f172acf3171f4cad6c22291 /drivers/staging/most | |
parent | 8abd537256f58c1e502c01fc4112afcf7c4eda96 (diff) | |
download | linux-3970d0d81816310175b6272e709ee09dd3e05171.tar.gz linux-3970d0d81816310175b6272e709ee09dd3e05171.tar.bz2 linux-3970d0d81816310175b6272e709ee09dd3e05171.zip |
staging: most: core: replace strcpy() by strscpy()
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: 131ac62253db ("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>
Diffstat (limited to 'drivers/staging/most')
-rw-r--r-- | drivers/staging/most/core.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/most/core.c b/drivers/staging/most/core.c index b1f7f707cacd..86a8545c8d97 100644 --- a/drivers/staging/most/core.c +++ b/drivers/staging/most/core.c @@ -1397,7 +1397,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; |