media: replace strcpy() by strscpy()
The strcpy() function is being deprecated upstream. Replace it by the safer strscpy(). Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org> Reviewed-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Tento commit je obsažen v:
@@ -429,8 +429,8 @@ static int tm6000_audio_init(struct tm6000_core *dev)
|
||||
snd_printk(KERN_ERR "cannot create card instance %d\n", devnr);
|
||||
return rc;
|
||||
}
|
||||
strcpy(card->driver, "tm6000-alsa");
|
||||
strcpy(card->shortname, "TM5600/60x0");
|
||||
strscpy(card->driver, "tm6000-alsa", sizeof(card->driver));
|
||||
strscpy(card->shortname, "TM5600/60x0", sizeof(card->shortname));
|
||||
sprintf(card->longname, "TM5600/60x0 Audio at bus %d device %d",
|
||||
dev->udev->bus->busnum, dev->udev->devnum);
|
||||
|
||||
@@ -456,7 +456,7 @@ static int tm6000_audio_init(struct tm6000_core *dev)
|
||||
|
||||
pcm->info_flags = 0;
|
||||
pcm->private_data = chip;
|
||||
strcpy(pcm->name, "Trident TM5600/60x0");
|
||||
strscpy(pcm->name, "Trident TM5600/60x0", sizeof(pcm->name));
|
||||
|
||||
snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_tm6000_pcm_ops);
|
||||
|
||||
|
@@ -1091,7 +1091,7 @@ static int vidioc_enum_input(struct file *file, void *priv,
|
||||
else
|
||||
i->type = V4L2_INPUT_TYPE_CAMERA;
|
||||
|
||||
strcpy(i->name, iname[dev->vinput[n].type]);
|
||||
strscpy(i->name, iname[dev->vinput[n].type], sizeof(i->name));
|
||||
|
||||
i->std = TM6000_STD;
|
||||
|
||||
@@ -1188,7 +1188,7 @@ static int vidioc_g_tuner(struct file *file, void *priv,
|
||||
if (0 != t->index)
|
||||
return -EINVAL;
|
||||
|
||||
strcpy(t->name, "Television");
|
||||
strscpy(t->name, "Television", sizeof(t->name));
|
||||
t->type = V4L2_TUNER_ANALOG_TV;
|
||||
t->capability = V4L2_TUNER_CAP_NORM | V4L2_TUNER_CAP_STEREO;
|
||||
t->rangehigh = 0xffffffffUL;
|
||||
@@ -1268,7 +1268,7 @@ static int radio_g_tuner(struct file *file, void *priv,
|
||||
return -EINVAL;
|
||||
|
||||
memset(t, 0, sizeof(*t));
|
||||
strcpy(t->name, "Radio");
|
||||
strscpy(t->name, "Radio", sizeof(t->name));
|
||||
t->type = V4L2_TUNER_RADIO;
|
||||
t->capability = V4L2_TUNER_CAP_LOW | V4L2_TUNER_CAP_STEREO;
|
||||
t->rxsubchans = V4L2_TUNER_SUB_STEREO;
|
||||
|
Odkázat v novém úkolu
Zablokovat Uživatele