I've confirmed enough buffer is allocated for output. (cherry picked from commit 87d1d3c3ec1c5609bd004c48c69c4a7349563230)