I asked, "Messenger of Allah, which sin is the greatest?"He replied, "That you set up a rival to Allah, when He is the One who created you."I asked, "Then which?"He said, "That you kill your child out of fear that he will eat with you."I asked, "Then which?"He said, "That you commit adultery with your neighbor's wife."
حدثنا عمرو بن علي قال حدثنا يحيى قال حدثنا سفيان قال حدثني واصل عن أبي وائل
قلت يا رسول الله أي الذنب أعظم قال أن تجعل لله ندا وهو خلقك قلت ثم أي قال أن تقتل ولدك من أجل أن يطعم معك قلت ثم أي قال ثم أن تزاني بحليلة جارك
Chapter, Bukhari reported it from the hadith of Yahya Qattan, as above, see the previous hadith. It is also in Sunan al-Kubra, hadith no. 3477.