The Prophet ﷺ said, "The child belongs to the marriage bed, and for the adulterer is the stone."
قال النبي ﷺ: الولد للفراش وللعاهر الحجر.
Bukhari narrated it in the Chapter on Punishments (6818) from Adam, who said, Shubah told us, Muhammad bin Ziyad told us, he said, I heard Abu Hurairah say, then he mentioned it. Muslim also narrated it in the Chapter on Suckling (1458) through other routes from Abu Hurairah in like manner.