Skip to content

Commit bf32bce

Browse files
arndbdtor
authored andcommitted
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: 628329d ("Input: add IMS Passenger Control Unit driver") Signed-off-by: Arnd Bergmann <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Dmitry Torokhov <[email protected]>
1 parent c7df39b commit bf32bce

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/input/misc/ims-pcu.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ struct ims_pcu_backlight {
4242
#define IMS_PCU_PART_NUMBER_LEN 15
4343
#define IMS_PCU_SERIAL_NUMBER_LEN 8
4444
#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
4747
#define IMS_PCU_BL_RESET_REASON_LEN (2 + 1)
4848

4949
#define IMS_PCU_PCU_B_DEVICE_ID 5

0 commit comments

Comments
 (0)