* [PATCH] video: fbdev: sis: sis_main.c: Cleaning up missing null-terminate in conjunction with strncpy
@ 2014-09-14 17:35 Rickard Strandqvist
2014-09-30 10:01 ` Tomi Valkeinen
0 siblings, 1 reply; 2+ messages in thread
From: Rickard Strandqvist @ 2014-09-14 17:35 UTC (permalink / raw)
To: Thomas Winischhofer, Jean-Christophe Plagniol-Villard
Cc: Rickard Strandqvist, Tomi Valkeinen, linux-fbdev, linux-kernel
Replacing strncpy with strlcpy to avoid strings that lacks null terminate.
Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
---
drivers/video/fbdev/sis/sis_main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/video/fbdev/sis/sis_main.c b/drivers/video/fbdev/sis/sis_main.c
index 3f12a2d..1f4c216 100644
--- a/drivers/video/fbdev/sis/sis_main.c
+++ b/drivers/video/fbdev/sis/sis_main.c
@@ -5830,7 +5830,7 @@ static int sisfb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
ivideo->cardnumber++;
}
- strncpy(ivideo->myid, chipinfo->chip_name, 30);
+ strlcpy(ivideo->myid, chipinfo->chip_name, sizeof(ivideo->myid));
ivideo->warncount = 0;
ivideo->chip_id = pdev->device;
--
1.7.10.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] video: fbdev: sis: sis_main.c: Cleaning up missing null-terminate in conjunction with strncpy
2014-09-14 17:35 [PATCH] video: fbdev: sis: sis_main.c: Cleaning up missing null-terminate in conjunction with strncpy Rickard Strandqvist
@ 2014-09-30 10:01 ` Tomi Valkeinen
0 siblings, 0 replies; 2+ messages in thread
From: Tomi Valkeinen @ 2014-09-30 10:01 UTC (permalink / raw)
To: Rickard Strandqvist, Thomas Winischhofer,
Jean-Christophe Plagniol-Villard
Cc: linux-fbdev, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 910 bytes --]
On 14/09/14 20:35, Rickard Strandqvist wrote:
> Replacing strncpy with strlcpy to avoid strings that lacks null terminate.
>
> Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
> ---
> drivers/video/fbdev/sis/sis_main.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/video/fbdev/sis/sis_main.c b/drivers/video/fbdev/sis/sis_main.c
> index 3f12a2d..1f4c216 100644
> --- a/drivers/video/fbdev/sis/sis_main.c
> +++ b/drivers/video/fbdev/sis/sis_main.c
> @@ -5830,7 +5830,7 @@ static int sisfb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
> ivideo->cardnumber++;
> }
>
> - strncpy(ivideo->myid, chipinfo->chip_name, 30);
> + strlcpy(ivideo->myid, chipinfo->chip_name, sizeof(ivideo->myid));
>
> ivideo->warncount = 0;
> ivideo->chip_id = pdev->device;
>
Thanks, queued for 3.18.
Tomi
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-09-30 10:01 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-14 17:35 [PATCH] video: fbdev: sis: sis_main.c: Cleaning up missing null-terminate in conjunction with strncpy Rickard Strandqvist
2014-09-30 10:01 ` Tomi Valkeinen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox