There was no space allocated for the terminating '\0' character... (cherry picked from commit b6c22a78)