All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] video: fbdev: sis: sis_main.c:  Cleaning up missing null-terminate in conjunction with strnc
@ 2014-09-14 17:35 ` Rickard Strandqvist
  0 siblings, 0 replies; 4+ 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] 4+ messages in thread

end of thread, other threads:[~2014-09-30 10:01 UTC | newest]

Thread overview: 4+ 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 strnc Rickard Strandqvist
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 ` [PATCH] video: fbdev: sis: sis_main.c: Cleaning up missing null-terminate in conjunction with s Tomi Valkeinen
2014-09-30 10:01   ` [PATCH] video: fbdev: sis: sis_main.c: Cleaning up missing null-terminate in conjunction with strncpy Tomi Valkeinen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.