]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
staging: media: atomisp: replace sprintf() with strscpy()
authorTomasz Unger <tomasz.unger@yahoo.pl>
Thu, 26 Feb 2026 11:16:53 +0000 (12:16 +0100)
committerSakari Ailus <sakari.ailus@linux.intel.com>
Wed, 20 May 2026 08:29:27 +0000 (11:29 +0300)
commitc565afd284e5b5f04e24b20018958ed7b9bc55a3
treec856e46ca98b9460f0defc04d7cb611723827a81
parent0812f34bf5dd3e1df495bf6f2c5fe4d140c10d37
staging: media: atomisp: replace sprintf() with strscpy()

Auditing calls to sprintf(). This code is fine because we are
copying 9 characters into a 52 character buffer. But it would
be cleaner to use strscpy() instead. Additionally, the 2-argument
version of strscpy() checks at compile time that dst is an array,
not just a pointer.

This is the only sprintf() call in the whole driver.

Signed-off-by: Tomasz Unger <tomasz.unger@yahoo.pl>
Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
drivers/staging/media/atomisp/pci/atomisp_subdev.c