fixbug: buffer_append memcpy one buffer to itself