Skip to contentSkip to conversation

sis: strcpy() => strlcpy()

PATCH New Dan Carpenter 1 participant 1 message Mar 22, 2010 Framebuffer layer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sis: strcpy() => strlcpy()

These are different size buffers (40 chars vs 16), we may as well be cautious.

drivers/video/sis/sis_main.c +1 -1
index a531a0f..559bf17 100644
@@ -1845,7 +1845,7 @@ sisfb_get_fix(struct fb_fix_screeninfo *fix, int con, struct fb_info *info)
 
 	memset(fix, 0, sizeof(struct fb_fix_screeninfo));
 
-	strcpy(fix->id, ivideo->myid);
+	strlcpy(fix->id, ivideo->myid, sizeof(fix->id));
 
 	mutex_lock(&info->mm_lock);
 	fix->smem_start  = ivideo->video_base + ivideo->video_offset;