]> git.baikalelectronics.ru Git - kernel.git/commit
drm: sysfs: Use scnprintf() for avoiding potential buffer overflow
authorTakashi Iwai <tiwai@suse.de>
Wed, 11 Mar 2020 07:35:40 +0000 (08:35 +0100)
committerThomas Zimmermann <tzimmermann@suse.de>
Wed, 11 Mar 2020 13:54:09 +0000 (14:54 +0100)
commit9b9f2219b2c4fa3d1a41245cdc263d09a4c9ad92
treef118a25f1b5dc0848ac7e4e506c0c47fe7d5654e
parent41252c6d1c3bc640c3283a797400719fbe7dcec1
drm: sysfs: Use scnprintf() for avoiding potential buffer overflow

Since snprintf() returns the would-be-output size instead of the
actual output size, the succeeding calls may go beyond the given
buffer limit.  Fix it by replacing with scnprintf().

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20200311073540.7108-1-tiwai@suse.de
drivers/gpu/drm/drm_sysfs.c