aboutsummaryrefslogtreecommitdiff
path: root/src/lib/cbfs_core.c
diff options
context:
space:
mode:
authorGabe Black <gabeblack@chromium.org>2013-07-01 04:28:23 -0700
committerRonald G. Minnich <rminnich@gmail.com>2013-07-15 18:53:37 +0200
commitc6b44162f5cccd72e9b4d9dbf071911249971846 (patch)
tree37a648e4fb3c7c41efa4a5276578ca8d9c101698 /src/lib/cbfs_core.c
parent630e4e8c7efa6306fb831cb1c9b6cabd53747a5a (diff)
CBFS: Use memmove instead of memcpy when loading a file from CBFS.
It might be the case that a file is being loaded from a portion of CBFS which has already been loaded into a limitted bit of memory somewhere, and we want to load that file in place, effectively, so that it's original location in CBFS overlaps with its new location. That's only guaranteed to work if you use memmove instead of memcpy. Change-Id: Id550138c875907749fff05f330fcd2fb5f9ed924 Signed-off-by: Gabe Black <gabeblack@chromium.org> Reviewed-on: http://review.coreboot.org/3577 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Diffstat (limited to 'src/lib/cbfs_core.c')
-rw-r--r--src/lib/cbfs_core.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lib/cbfs_core.c b/src/lib/cbfs_core.c
index 852b37fcdf..39c1ff6008 100644
--- a/src/lib/cbfs_core.c
+++ b/src/lib/cbfs_core.c
@@ -195,7 +195,7 @@ int cbfs_decompress(int algo, void *src, void *dst, int len)
{
switch (algo) {
case CBFS_COMPRESS_NONE:
- memcpy(dst, src, len);
+ memmove(dst, src, len);
return 0;
#ifdef CBFS_CORE_WITH_LZMA
case CBFS_COMPRESS_LZMA: