Hadith 5018
وَعَن أبي سعيد أَنَّهُ سَمِعَ النَّبِيَّ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ يَقُولُ: «لَا تُصَاحِبْ إِلَّا مُؤْمِنًا وَلَا يَأْكُلْ طَعَامَكَ إِلَّا تَقِيٌّ» . رَوَاهُ التِّرْمِذِيُّ وَأَبُو دَاوُدَ والدارمي
It is narrated from Abu Sa'id (may Allah be pleased with him) that he heard the Prophet (peace and blessings of Allah be upon him) say: "You should only keep the company of a believer, and only a pious person should eat your food." Its chain is authentic. Narrated by al-Tirmidhi, Abu Dawood, and al-Darimi.