lib/os/heap: fix out-of-bounds usage of memcpy() in sys_heap_realloc()
lib/os/heap: fix out-of-bounds usage of memcpy() in sys_heap_realloc()

The sys_heap_realloc() code falls back to allocating new memory
and copying the existing data over when it cannot adjust the size
in place. However the size of the data to copy should be the old
size and not the new size if we're extending the allocation.

Signed-off-by: Nicolas Pitre <76342682d5afc62854e1102d9578521fe1ed6813@baylibre.com>

Vudentz/zephyr,Vudentz/zephyr,finikorg/zephyr,nashif/zephyr,Vudentz/zephyr,galak/zephyr,nashif/zephyr,nashif/zephyr,zephyrproject-rtos/zephyr,galak/zephyr,Vudentz/zephyr,zephyrproject-rtos/zephyr,nashif/zephyr,Vudentz/zephyr,finikorg/zephyr,galak/zephyr,finikorg/zephyr,finikorg/zephyr,galak/zephyr,galak/zephyr,zephyrproject-rtos/zephyr,zephyrproject-rtos/zephyr,finikorg/zephyr,zephyrproject-rtos/zephyr,Vudentz/zephyr,nashif/zephyr