summaryrefslogtreecommitdiffstats
path: root/drivers/video/fsl-diu-fb.c
diff options
context:
space:
mode:
authorTimur Tabi <timur@freescale.com>2011-09-15 23:44:54 +0200
committerFlorian Tobias Schandinat <FlorianSchandinat@gmx.de>2011-09-18 22:08:57 +0200
commitec02dd23dc423cf019f660a63ac9c9d54840a473 (patch)
tree746c6f1e2284eebdad5d759983c3351b076045e9 /drivers/video/fsl-diu-fb.c
parentdrivers/video: fsl-diu-fb: set the driver name to "fsl-diu-fb" (diff)
downloadlinux-ec02dd23dc423cf019f660a63ac9c9d54840a473.tar.xz
linux-ec02dd23dc423cf019f660a63ac9c9d54840a473.zip
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)
struct fb_var_screeninfo *var = &info->var;
struct mfb_info *mfbi = info->par;
- strncpy(fix->id, mfbi->id, strlen(mfbi->id));
+ strncpy(fix->id, mfbi->id, sizeof(fix->id));
fix->line_length = var->xres_virtual * var->bits_per_pixel / 8;
fix->type = FB_TYPE_PACKED_PIXELS;
fix->accel = FB_ACCEL_NONE;