]> git.baikalelectronics.ru Git - kernel.git/commit
drm/modes: Fix unterminated strncpy
authorChuhong Yuan <hslester96@gmail.com>
Wed, 31 Jul 2019 02:01:40 +0000 (10:01 +0800)
committerMaxime Ripard <maxime.ripard@bootlin.com>
Sat, 3 Aug 2019 10:03:01 +0000 (12:03 +0200)
commit5692afca77e8f2c0e90439de77117ffa759ea087
tree1041e65119331850ae8a872449a421130c9b3536
parent8c908abf729470c95bdda099bbed2165908bc13f
drm/modes: Fix unterminated strncpy

strncpy(dest, src, strlen(src)) leads to unterminated
dest, which is dangerous.
Fix it by using strscpy.

Fixes: 555697d726f0 ("drm/modes: Support modes names on the command line")
Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190731020140.3529-1-hslester96@gmail.com
drivers/gpu/drm/drm_modes.c