Fix stack overflow in string creation (Bug#6214).