I ate some garlic, then came to the place where the Prophet ﷺ was praying, after one rakah had already passed. When I entered the mosque, the Prophet ﷺ caught the smell of garlic. When the Messenger of Allah ﷺ had finished his prayer, he said, "Whoever has eaten from this plant should not come near us until its smell, or his smell, has gone away."When the prayer was over, I came to the Messenger of Allah ﷺ and said, "Messenger of Allah, by Allah, give me your hand."He gave me his hand, and I slipped it inside the sleeve of my shirt up to my chest, where he found my chest tightly bound. He said, "You have a valid excuse."
أكلت ثوما، فأتيت مصلى النبي ﷺ، وقد سبقت بركعة، فلما دخلت المسجد وجدالنبي ﷺ ريح الثوم. فلما قضى رسول الله ﷺ صلاته قال: من أكل هذه الشجرة فلا يقرب حتى يذهب ريحها أو ريحه فلما قضيت الصلاة جئت إلى رسول الله ﷺ فقلت: يا رسول الله! والله تعطيني يدك، قال: فأدخلت يده في كم قميصي إلى صدري، فإذا أنا معصوب الصدر، قال: إن لك عذرا.
Abu Dawud (3826) and Ibn Khuzayma in his Sahih (1672) both narrated it through routes from Humayd bin Hilal, from Abu Burda, from Mughira bin Shuba, mentioning the like of it. Its isnad is sahih.As for his saying, "with his chest bound," it means that he had tied up his belly from hunger, so the Prophet ﷺ gave him permission and accepted his excuse.