Sahih Muslim , Hadith 1457

'A'isha (Allah be pleased with her) reported: Sa'd b. Abu Waqqas and Abd b. Zam'a (Allah be pleased with them) disputed with each other over a young boy. Sa'd said: Messenger of Allah, he is the son of my brother 'Utba b. Abu Waqqas as he made it explicit that he was his son. Look at his resemblance. Abd b. Zam'a said Messenger of Allah, he is my brother as he was born on the bed of my father from his slave-girl. Allah's Messenger looked at his resemblance and found a clear resemblance with 'Utba. (But) he said: "He is yours O 'Abd (b. Zam'a), for the child is to be attributed to one on whose bed it is born, and stoning for a fornicator. Sauda bint Zam'a, O you should observe veil from him." So he did not see Sauda at all. Muhammad b. Rumh did not make a mention (of the words): "O Abd."

حَدَّثَنَا قُتَيْبَةُ بْنُ سَعِيدٍ، حَدَّثَنَا لَيْثٌ، ح وَحَدَّثَنَا مُحَمَّدُ بْنُ رُمْحٍ، أَخْبَرَنَا اللَّيْثُ، عَنِ ابْنِ شِهَابٍ، عَنْ عُرْوَةَ، عَنْ عَائِشَةَ، أَنَّهَا قَالَتِ اخْتَصَمَ سَعْدُ بْنُ أَبِي وَقَّاصٍ وَعَبْدُ بْنُ زَمْعَةَ فِي غُلاَمٍ فَقَالَ سَعْدٌ هَذَا يَا رَسُولَ اللَّهِ ابْنُ أَخِي عُتْبَةَ بْنِ أَبِي وَقَّاصٍ عَهِدَ إِلَىَّ أَنَّهُ ابْنُهُ انْظُرْ إِلَى شَبَهِهِ وَقَالَ عَبْدُ بْنُ زَمْعَةَ هَذَا أَخِي يَا رَسُولَ اللَّهِ وُلِدَ عَلَى فِرَاشِ أَبِي مِنْ وَلِيدَتِهِ فَنَظَرَ رَسُولُ اللَّهِ صلى الله عليه وسلم إِلَى شَبَهِهِ فَرَأَى شَبَهًا بَيِّنًا بِعُتْبَةَ فَقَالَ ‏"‏ هُوَ لَكَ يَا عَبْدُ الْوَلَدُ لِلْفِرَاَشِ وَلِلْعَاهِرِ الْحَجَرُ وَاحْتَجِبِي مِنْهُ يَا سَوْدَةُ بِنْتَ زَمْعَةَ ‏"‏ ‏.‏ قَالَتْ فَلَمْ يَرَ سَوْدَةَ قَطُّ وَلَمْ يَذْكُرْ مُحَمَّدُ بْنُ رُمْحٍ قَوْلَهُ ‏"‏ يَا عَبْدُ ‏"‏ ‏.‏

sunnah.com

A hadith like this is narrated on the authority of Ibn 'Uyaiyna and Ma'mar (and the words are): The child is attributed to him on whose bed he is born; but they did not mention this:" For a fornicator there is stoning."

حَدَّثَنَا سَعِيدُ بْنُ مَنْصُورٍ، وَأَبُو بَكْرِ بْنُ أَبِي شَيْبَةَ وَعَمْرٌو النَّاقِدُ قَالُوا حَدَّثَنَا سُفْيَانُ، بْنُ عُيَيْنَةَ ح وَحَدَّثَنَا عَبْدُ بْنُ حُمَيْدٍ، أَخْبَرَنَا عَبْدُ الرَّزَّاقِ، أَخْبَرَنَا مَعْمَرٌ، كِلاَهُمَا عَنِ الزُّهْرِيِّ، بِهَذَا الإِسْنَادِ نَحْوَهُ ‏.‏ غَيْرَ أَنَّ مَعْمَرًا وَابْنَ عُيَيْنَةَ فِي حَدِيثِهِمَا ‏"‏ الْوَلَدُ لِلْفِرَاشِ ‏"‏ ‏.‏ وَلَمْ يَذْكُرَا ‏"‏ وَلِلْعَاهِرِ الْحَجَرُ ‏"‏ ‏.‏

sunnah.com