use memcpy, cause segment fault