Skip to content

Commit f21431f

Browse files
tiwaidlezcano
authored andcommitted
thermal: int340x_thermal: 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 <[email protected]> Reviewed-by: Pandruvada, Srinivas <[email protected]> Signed-off-by: Daniel Lezcano <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 671aa92 commit f21431f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/thermal/intel/int340x_thermal/int3400_thermal.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ static ssize_t available_uuids_show(struct device *dev,
6565
for (i = 0; i < INT3400_THERMAL_MAXIMUM_UUID; i++) {
6666
if (priv->uuid_bitmap & (1 << i))
6767
if (PAGE_SIZE - length > 0)
68-
length += snprintf(&buf[length],
68+
length += scnprintf(&buf[length],
6969
PAGE_SIZE - length,
7070
"%s\n",
7171
int3400_thermal_uuids[i]);

0 commit comments

Comments
 (0)