[CVE-2022-25314] Prevent integer overflow in copyString