[U-Boot] [U-Boot, v2, 3/8] sandbox: Use memcpy() to move overlapping regions

Tom Rini trini at konsulko.com
Tue Jun 19 18:40:21 UTC 2018


On Tue, Jun 12, 2018 at 12:04:57AM -0600, 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 memcpy() instead.
> 
> Reported-by: Coverity (CID: 173279)
> Signed-off-by: Simon Glass <sjg at chromium.org>
> ---
> 
> Changes in v2:
> - Also remove the leading / from the "/spl" path
> 
>  arch/sandbox/cpu/os.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)

This ends up breaking the sandbox_spl portions of 'make tests.

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180619/87c174b8/attachment.sig>


More information about the U-Boot mailing list