It is not enough to copy max of destination buffer size bytes, the source might be smaller than the destination size.