Sahih Muslim Book 8, Hadith Number 3435.

Chapter: The child is attributed to one on whose bed it is born and one must avoid suspicion.

‘Aisha (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 (way peace he upon him) 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.”