(17) The Book of Suckling
كتاب الرضاع
(10) Chapter: The child is for the bed and suspicion must be avoided
(10) باب الْوَلَدِ لِلْفِرَاشِ وَتَوَقِّي الشُّبُهَاتِ ‏‏
Sahih Muslim 1458 a 

Abu Huraira (Allah be pleased with him) reported Allah's Messenger (ﷺ) as saying:

The child is to be attributed to one on whose bed he is born, and for a fornicator there is stoning.
وَحَدَّثَنِي مُحَمَّدُ بْنُ رَافِعٍ، وَعَبْدُ بْنُ حُمَيْدٍ، - قَالَ ابْنُ رَافِعٍ - حَدَّثَنَا عَبْدُ الرَّزَّاقِ، أَخْبَرَنَا مَعْمَرٌ، عَنِ الزُّهْرِيِّ، عَنِ ابْنِ الْمُسَيَّبِ، وَأَبِي، سَلَمَةَ عَنْ أَبِي هُرَيْرَةَ، أَنَّ رَسُولَ اللَّهِ صلى الله عليه وسلم قَالَ ‏ "‏ الْوَلَدُ لِلْفِرَاشِ وَلِلْعَاهِرِ الْحَجَرُ ‏"‏ ‏.‏
Reference : Sahih Muslim 1458a
In-book reference : Book 17, Hadith 48
USC-MSA web (English) reference : Book 8, Hadith 3437
  (deprecated numbering scheme)