The defensive copy is not needed because the name may not alias the output buffer. (cherry picked from commit 317b199b) (cherry picked from commit 883dceeb)