The Prophet ﷺ addressed the people while seated on his mount. The animal was chewing its cud, and its saliva was dripping between his shoulders. He said, "Allah has assigned to each heir his share of the inheritance, so a bequest in favor of an heir is not permitted."
أن النبي ﷺ خطبهم وهو على راحلته، وإن راحلته لتقصع بجرتها، وإن لعابها ليسيل بين كتفي قال: إن الله قسم لكل وارث نصيبه من الميراث، فلا يجوز لوارث وصية.
It was narrated by Tirmidhi (2121), Nasai (6/247), Ibn Majah (2712), and Ahmad (17669), all through routes from Qatada, from Shahr bin Hawshab, from Abdul-Rahman bin Ghanm, from Amr bin Kharija, and he mentioned it within a longer hadith that has already been documented in the chapter on the two Eids. Tirmidhi said, "Hasan sahih."I say, its chain is hasan due to the discussion surrounding Shahr bin Hawshab, though he is hasan al-hadith when he does not contradict others and nothing objectionable appears in his narration. As for Amr bin Kharija, it has been said this way, and it has also been said Kharija bin Amr. The first is more correct.