I heard the Messenger of Allah ﷺ say, "What is lawful is clear and what is unlawful is clear, and between the two are doubtful matters that many people do not know whether they belong to the lawful or the unlawful. Whoever leaves them aside to protect his religion and his honor is safe, but whoever falls into any of them is on the verge of falling into what is unlawful, just as one who grazes his flock around a protected pasture is on the verge of letting them graze in it. Be aware that every king has a protected pasture, and be aware that the protected pasture of Allah is what He has forbidden."Hannad narrated to us, Waki narrated to us, from Zakariyya bin Abu Zaidah, from Shaybi, from Numan bin Bashir, from the Prophet ﷺ, something similar with the same meaning.
حدثنا قتيبة بن سعيد أنبأنا حماد بن زيد عن مجالد عن الشعبي
سمعت رسول الله ﷺ يقول الحلال بين والحرام بين وبين ذلك أمور مشتبهات لا يدري كثير من الناس أمن الحلال هي أم من الحرام فمن تركها استبراء لدينه وعرضه فقد سلم ومن واقع شيئا منها يوشك أن يواقع الحرام كما أنه من يرعى حول الحمى يوشك أن يواقعه ألا وإن لكل ملك حمى ألا وإن حمى الله محارمه حدثنا هناد حدثنا وكيع عن زكريا بن أبي زائدة عن الشعبي عن النعمان بن بشير عن النبي ﷺ نحوه بمعناه
[Sahih] Ahmad narrated it, 4/269, from the hadith of Mujalid, through him. Bukhari, no. 52, and Muslim, no. 1599, narrated it from the hadith of Shaybi, through him.