From: Rabbi Moshe Sofer
To: Rabbi Hersh
A woman gave birth approximately five and a half months after marriage, raising suspicions of pre-marital infidelity. The Chasam Sofer rules leniently, holding that the birth is attributed to the husband via the principle of yoledes l'shiva yoledes l'mikuta'im with shufra garim, reinforced by the presumption of a married woman's fidelity, and declares both the wife and daughter kosher.
Source: Shu"t Chasam Sofer EH I §6