test malloc and memcpy for received payload