From nobody Fri Apr 17 07:43:04 2026 Received: from out-183.mta1.migadu.com (out-183.mta1.migadu.com [95.215.58.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5411DF4F1 for ; Mon, 23 Feb 2026 07:33:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.183 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771831994; cv=none; b=rQMhRyy4yu8H06QOWEW/FMFkpPs5S044wKk0F4PPnQIjgxFiDB4qmtfW+WGx90WYrZqLz2OA0f6L/4OJf2csQgYSc+eEj8ZVLUB/oPPlYkGIafN+og+Y+ONMg5tP2866Ib7yPdkklVm2pxt9xziu1FVZznbk33oe44UL8aH6y28= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771831994; c=relaxed/simple; bh=7/2HPigpGCQO2AqJXDDdenp9sZBWQNqsF/KbidOOWH0=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=lc6+6T02jnUR7i9jxXhvkme3sWah+X2S7Qp7rLA+xa9TqeNr+UcPm38Bq8W/SO+lIKHNqD4I7KKs3XflNNV0AmMozNiNW0w9R/g59qRD2xkJ9AyDGvpU396IxkMaDjkcUF0H9I+qL9bzxTUOlIxG2MmXmarkyAuVIXUk7SLA/dU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=NnoME9xj; arc=none smtp.client-ip=95.215.58.183 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="NnoME9xj" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1771831989; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=dsdJ0mPdCvq93RkvuKqz6BdF4skOlq2L4R6MFvOvoQU=; b=NnoME9xj/rG7s6s809ik7qfLyQQFkOK+dkItX805dGyzZgQKfXsDYocvr8CjiVi0uWPcjl FRp2fUv24lQiMg2VuiPgasoo5Z+x2LmGC/ncJfe1oo1VZgoGV/nfemnuUjVLFJ9ai7zAVH e8lV8LAVdhbzQ33xaWqhB747O6zv5fc= From: Thorsten Blum To: "Rafael J. Wysocki" , Daniel Lezcano , Zhang Rui , Lukasz Luba Cc: Thorsten Blum , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] thermal: core: Replace sprintf in thermal_bind_cdev_to_trip Date: Mon, 23 Feb 2026 08:32:45 +0100 Message-ID: <20260223073245.321298-2-thorsten.blum@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT Content-Type: text/plain; charset="utf-8" Replace unbounded sprintf() with the safer snprintf(). While the current code works correctly, snprintf() is safer and follows secure coding best practices. No functional changes. Signed-off-by: Thorsten Blum Reviewed-by: Lukasz Luba --- drivers/thermal/thermal_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c index 17ca5c082643..89dd1666805f 100644 --- a/drivers/thermal/thermal_core.c +++ b/drivers/thermal/thermal_core.c @@ -861,7 +861,7 @@ static int thermal_bind_cdev_to_trip(struct thermal_zon= e_device *tz, goto free_mem; =20 dev->id =3D result; - sprintf(dev->name, "cdev%d", dev->id); + snprintf(dev->name, sizeof(dev->name), "cdev%d", dev->id); result =3D sysfs_create_link(&tz->device.kobj, &cdev->device.kobj, dev->name); if (result) --=20 Thorsten Blum GPG: 1D60 735E 8AEF 3BE4 73B6 9D84 7336 78FD 8DFE EAD4