]> git.dujemihanovic.xyz Git - u-boot.git/commit
dm: serial: fix serial_post_probe()
authorHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Fri, 29 Sep 2023 00:47:16 +0000 (02:47 +0200)
committerTom Rini <trini@konsulko.com>
Mon, 9 Oct 2023 19:24:31 +0000 (15:24 -0400)
commit6a1e0ae43e2108a88e022103b3b303c9f4964a64
treee6e1c1e478ca5a0d9a5be1f14cc5dc9ed6a06bbc
parent6826c432e35115bbdafc17062733f5030b7f8366
dm: serial: fix serial_post_probe()

The size of the name of a udevice is not limited.

When setting the fixed sized name field of a stdio device we must ensure
that the target string is NUL terminated to avoid buffer overflows.

Fixes: 57d92753d4ca ("dm: Add a uclass for serial devices")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
drivers/serial/serial-uclass.c