[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <169590849042.1603670.14283146758350554856.b4-ty@kernel.org>
Date: Thu, 28 Sep 2023 14:41:30 +0100
From: Lee Jones <lee@...nel.org>
To: Pavel Machek <pavel@....cz>, Lee Jones <lee@...nel.org>,
Justin Stitt <justinstitt@...gle.com>
Cc: linux-leds@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-hardening@...r.kernel.org
Subject: Re: (subset) [PATCH] leds: lp3952: replace deprecated strncpy with
strscpy
On Fri, 22 Sep 2023 15:27:17 +0000, Justin Stitt wrote:
> `strncpy` is deprecated for use on NUL-terminated destination strings
> [1] and as such we should prefer more robust and less ambiguous string
> interfaces.
>
> We expect `dest` to be NUL-terminated due to its use with dev_err.
>
> lp3952_get_label()'s dest argument is priv->leds[i].name:
> | acpi_ret = lp3952_get_label(&priv->client->dev, led_name_hdl[i],
> | priv->leds[i].name);
> ... which is then assigned to:
> | priv->leds[i].cdev.name = priv->leds[i].name;
> ... which is used with a format string
> | dev_err(&priv->client->dev,
> | "couldn't register LED %s\n",
> | priv->leds[i].cdev.name);
>
> [...]
Applied, thanks!
[1/1] leds: lp3952: replace deprecated strncpy with strscpy
commit: 821d3ff4b4e2c689576a623348555114e3f2f1c2
--
Lee Jones [李琼斯]
Powered by blists - more mailing lists