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

Yahya related to me from Malik from Nafi that Abdullah ibn Umarused to say, "No-one should pray over a dead person unless he is inwudu." Yahya said that he heard Malik say, "I have not seenany person of knowledge disapproving of praying over either a childborn of adultery or its mother." Translation Not Available

Book Ref: Muwatta Imam Malik Book 16 Hadith 548
Web Ref:  Muwatta Imam Malik Book 16 Hadith 26