Re: [PATCH] tty: xtensa/iss: use strnlen to improve iss_console_write

From: Max Filippov

Date: Thu Apr 30 2026 - 05:52:31 EST


On Thu, Apr 30, 2026 at 2:04 AM Thorsten Blum <thorsten.blum@xxxxxxxxx> wrote:
>
> Use strnlen() to limit scanning 's' to 'count' bytes. Use the length of
> 's' to decide if simc_write() should be called instead of dereferencing
> it first and then calling strlen().
>
> With strnlen(), iss_console_write() is further hardened against callers
> where 's' is not NUL-terminated.
>
> Signed-off-by: Thorsten Blum <thorsten.blum@xxxxxxxxx>
> ---
> arch/xtensa/platforms/iss/console.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)

Thanks. Applied to my xtensa tree.

-- Max