Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Input: ims-pcu - fix printf string overflow

clang warns about a string overflow in this driver

drivers/input/misc/ims-pcu.c:1802:2: error: 'snprintf' will always be truncated; specified size is 10, but format string expands to at least 12 [-Werror,-Wformat-truncation]
drivers/input/misc/ims-pcu.c:1814:2: error: 'snprintf' will always be truncated; specified size is 10, but format string expands to at least 12 [-Werror,-Wformat-truncation]

Make the buffer a little longer to ensure it always fits.

Fixes: 628329d52474 ("Input: add IMS Passenger Control Unit driver")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/20240326223825.4084412-7-arnd@kernel.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

authored by

Arnd Bergmann and committed by
Dmitry Torokhov
bf32bcee c7df39b2

+2 -2
+2 -2
drivers/input/misc/ims-pcu.c
··· 42 42 #define IMS_PCU_PART_NUMBER_LEN 15 43 43 #define IMS_PCU_SERIAL_NUMBER_LEN 8 44 44 #define IMS_PCU_DOM_LEN 8 45 - #define IMS_PCU_FW_VERSION_LEN (9 + 1) 46 - #define IMS_PCU_BL_VERSION_LEN (9 + 1) 45 + #define IMS_PCU_FW_VERSION_LEN 16 46 + #define IMS_PCU_BL_VERSION_LEN 16 47 47 #define IMS_PCU_BL_RESET_REASON_LEN (2 + 1) 48 48 49 49 #define IMS_PCU_PCU_B_DEVICE_ID 5