Re: [PATCH 4/8] usb: sandbox: Check for string end in copy_to_unicode()

Simon Glass
2022-04-11T18:37:33Z

On Sun, 3 Apr 2022 at 04:39, Andrew Scull <ascull@google.com> wrote:
>
> When copying the string in copy_to_unicode(), check for the null
> terminator in each position, not just at the start, to avoid reading
> beyond the end of the string.
>
> Signed-off-by: Andrew Scull <ascull@google.com>
> Cc: Simon Glass <sjg@chromium.org>
> Cc: Marek Vasut <marex@denx.de>
> ---
> drivers/usb/emul/usb-emul-uclass.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)

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