[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <87cybawgq0.wl-tiwai@suse.de>
Date: Wed, 11 Jun 2025 15:27:51 +0200
From: Takashi Iwai <tiwai@...e.de>
To: Dan Carpenter <dan.carpenter@...aro.org>
Cc: Jaroslav Kysela <perex@...ex.cz>,
Takashi Iwai <tiwai@...e.com>,
Lucy Thrun <lucy.thrun@...ital-rabbithole.de>,
linux-sound@...r.kernel.org,
linux-kernel@...r.kernel.org,
kernel-janitors@...r.kernel.org
Subject: Re: [PATCH] ALSA: hda/ca0132: use snprintf() for kernel hardenning
On Wed, 11 Jun 2025 15:08:33 +0200,
Dan Carpenter wrote:
>
> In this sprintf():
>
> sprintf(namestr, "%s %s Volume", name, dirstr[dir]);
>
> Then "namestr" and "name" buffer are both SNDRV_CTL_ELEM_ID_NAME_MAXLEN
> (44) characters long. We never actually use that full amount in real
> life so everything works fine, but static checkers complain that if name
> is 44 characters then when you combine that with the other strings it
> will lead to a buffer overflow. Using snprintf() silences the warning
> and makes the code a little bit safer for the future.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@...aro.org>
Thanks for the patch, but the very same fix was already submitted from
Lucy and merged in commit a409c60111e6.
Takashi
Powered by blists - more mailing lists