]> git.baikalelectronics.ru Git - uboot.git/commit
sandbox: Use memmove() to move overlapping regions
authorSimon Glass <sjg@chromium.org>
Tue, 13 Nov 2018 22:55:20 +0000 (15:55 -0700)
committerSimon Glass <sjg@chromium.org>
Thu, 29 Nov 2018 16:30:05 +0000 (09:30 -0700)
commit930dae65f72e4c435d3e07bb763e443ca11619a4
treec9ec260d70d07f99e5bc96d4109d698c131db5bb
parent5484882eef56b6980701c2311bb46ce37d640b3a
sandbox: Use memmove() to move overlapping regions

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@chromium.org>
Reviewed-by: Alexander Graf <agraf@suse.de>
arch/sandbox/cpu/os.c