thermal: core: prevent potential string overflow
authorDan Carpenter <dan.carpenter@linaro.org>
Sat, 7 Oct 2023 08:59:39 +0000 (11:59 +0300)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 11 Oct 2023 14:15:09 +0000 (16:15 +0200)
commitc99626092efca3061b387043d4a7399bf75fbdd5
tree32e0d660a1ec3dd3baa69c04829c3cb97186fc5e
parente17ea8a1b1707f11df900adbd0764880aea2b1e1
thermal: core: prevent potential string overflow

The dev->id value comes from ida_alloc() so it's a number between zero
and INT_MAX.  If it's too high then these sprintf()s will overflow.

Fixes: 203d3d4aa482 ("the generic thermal sysfs driver")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/thermal/thermal_core.c