[PATCH 2/2] stdio: fix stdio_deregister_dev()

Simon Glass sjg at chromium.org
Mon Oct 2 03:16:44 CEST 2023


On Thu, 28 Sept 2023 at 18:47, Heinrich Schuchardt
<heinrich.schuchardt at canonical.com> wrote:
>
> When copying the name of a stdio device we must ensure that it is NUL
> terminated before passing it to strcmp() to avoid a buffer overrun.
>
> Truncating the name field leads to failure to deregister a stdio device.
> When copying we must ensure that the name field sizes match.
>
> Addresses-Coverity-ID: 350462 String not null terminated
> Fixes: 5294e97832a6 ("stdio: extend "name" to 32 symbols")
> Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt at canonical.com>
> ---
>  common/stdio.c      | 6 +++---
>  include/stdio_dev.h | 3 ++-
>  2 files changed, 5 insertions(+), 4 deletions(-)
>

Reviewed-by: Simon Glass <sjg at chromium.org>


More information about the U-Boot mailing list