]> git.baikalelectronics.ru Git - kernel.git/commit
drm/i915/gt: Use scnprintf() for avoiding potential buffer overflow
authorTakashi Iwai <tiwai@suse.de>
Wed, 11 Mar 2020 07:32:56 +0000 (08:32 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Wed, 11 Mar 2020 10:54:59 +0000 (10:54 +0000)
commitefcb0c56415b66b3e1ecf267b47787913a04dc73
treefa24b07b4780965d4cc57fe5fc473bc27f18006d
parent203ad044bc053dfdb069ef52ad464f89f49d6e1e
drm/i915/gt: 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: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Link: https://patchwork.freedesktop.org/patch/msgid/20200311073256.6535-1-tiwai@suse.de
drivers/gpu/drm/i915/gt/intel_engine_cs.c