mirror of https://github.com/thesofproject/sof.git
memcpy: fix bug in memcpy_s for cmocka
memcpy_s has wrong check condition for overlapping sections. The copy from adjacent memory bloks will result in dsp panic while it should be allowed. This patch fixes the issue for cmocka tests. Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
This commit is contained in:
parent
c357561ec9
commit
afbb2a6f53
|
@ -13,8 +13,8 @@ int memcpy_s(void *dest, size_t dest_size,
|
||||||
if (!dest || !src)
|
if (!dest || !src)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
if ((dest + dest_size >= src && dest + dest_size <= src + src_size) ||
|
if ((dest >= src && dest < (src + src_size)) ||
|
||||||
(src + src_size >= dest && src + src_size <= dest + dest_size))
|
(src >= dest && src < (dest + dest_size)))
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
if (src_size > dest_size)
|
if (src_size > dest_size)
|
||||||
|
|
Loading…
Reference in New Issue