aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/fsl-diu-fb.c
diff options
context:
space:
mode:
authorTimur Tabi <timur@freescale.com>2011-09-15 17:44:54 -0400
committerFlorian Tobias Schandinat <FlorianSchandinat@gmx.de>2011-09-18 16:08:57 -0400
commitec02dd23dc423cf019f660a63ac9c9d54840a473 (patch)
tree746c6f1e2284eebdad5d759983c3351b076045e9 /drivers/video/fsl-diu-fb.c
parentf8c6bf6ae677663adbf91b882755e3f757fb1669 (diff)
drivers/video: fsl-diu-fb: fix potential memcpy buffer overflow bug
It makes no sense to limit the size of a strncpy() to the length of the source string. Signed-off-by: Timur Tabi <timur@freescale.com> Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Diffstat (limited to 'drivers/video/fsl-diu-fb.c')
-rw-r--r--drivers/video/fsl-diu-fb.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/video/fsl-diu-fb.c b/drivers/video/fsl-diu-fb.c
index 19bfbf5bb980..3776949d6183 100644
--- a/drivers/video/fsl-diu-fb.c
+++ b/drivers/video/fsl-diu-fb.c
@@ -655,7 +655,7 @@ static void set_fix(struct fb_info *info)
655 struct fb_var_screeninfo *var = &info->var; 655 struct fb_var_screeninfo *var = &info->var;
656 struct mfb_info *mfbi = info->par; 656 struct mfb_info *mfbi = info->par;
657 657
658 strncpy(fix->id, mfbi->id, strlen(mfbi->id)); 658 strncpy(fix->id, mfbi->id, sizeof(fix->id));
659 fix->line_length = var->xres_virtual * var->bits_per_pixel / 8; 659 fix->line_length = var->xres_virtual * var->bits_per_pixel / 8;
660 fix->type = FB_TYPE_PACKED_PIXELS; 660 fix->type = FB_TYPE_PACKED_PIXELS;
661 fix->accel = FB_ACCEL_NONE; 661 fix->accel = FB_ACCEL_NONE;