[U-Boot] [PATCH v3] sandbox: Use memmove() to move overlapping regions

sjg at google.com sjg at google.com
Thu Nov 29 17:42:17 UTC 2018


On 11/13/2018 11:55 PM, Simon Glass wrote:
> The use of strcpy() to remove characters at the start of a string is safe
> in U-Boot, since we know the implementation. But in os.c we are using the
> C library's strcpy() function, where this behaviour is not permitted.
>
> Update the code to use memmove() instead.
>
> Reported-by: Coverity (CID: 173279)
> Signed-off-by: Simon Glass <sjg at chromium.org>

Reviewed-by: Alexander Graf <agraf at suse.de>

Alex

> ---
>
> Changes in v3:
> - Fix commit message to say memmove() instead of memcpy()
>
> Changes in v2:
> - Also remove the leading / from the "/spl" path
> - Correct the string calculation
>
>   arch/sandbox/cpu/os.c | 5 +++--
>   1 file changed, 3 insertions(+), 2 deletions(-)
>
Applied to u-boot-dm/master, thanks!


More information about the U-Boot mailing list