Mishkat al-Masabih 3073
Abu Umama told of hearing God’s Messenger say in his sermon in the year of the Farewell Pilgrimage, “God has appointed for everyone who has a right what is due to him, and no legacy must be made to an heir.” 

Abu Dawud and Ibn Majah transmitted it.

Tirmidhi added:
“The child is attributed to the mother’s husband, but the adulterer gets nothing, and their reckoning is in God’s hands.”
وَعَنْ أَبِي أُمَامَةَ قَالَ: سَمِعْتُ رَسُولَ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ يَقُولُ فِي خُطْبَتِهِ عَامَ حَجَّةِ الْوَدَاعِ: «إِنِ اللَّهَ قَدْ أَعْطَى كُلَّ ذِي حَقٍّ حَقَّهُ فَلَا وَصِيَّةَ لِوَارِثٍ» . رَوَاهُ أَبُو دَاوُدَ وَابْنُ مَاجَهْ وَزَادَ التِّرْمِذِيُّ: «الْوَلَدُ لِلْفَرَاشِ وَلِلْعَاهِرِ الْحَجَرُ وَحِسَابُهُمْ عَلَى اللَّهِ»