]> git.baikalelectronics.ru Git - uboot.git/commit
usb: sandbox: Check for string end in copy_to_unicode()
authorAndrew Scull <ascull@google.com>
Sun, 3 Apr 2022 10:39:11 +0000 (10:39 +0000)
committerTom Rini <trini@konsulko.com>
Fri, 29 Apr 2022 15:11:36 +0000 (11:11 -0400)
commit2f8e0a76e221581bfbe9bc952df7f4bd41f4e4d3
treebe9aa0846e9cc1b37f7bed6e7f897f8a2664e067
parent0ceea580ce50574eb5c18449299b15bab6f547c1
usb: sandbox: Check for string end in copy_to_unicode()

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>
Reviewed-by: Simon Glass <sjg@chromium.org>
drivers/usb/emul/usb-emul-uclass.c