Abbad bin Shurahbil reported,

I was struck by a year of hardship, so I entered one of the orchards of Madinah, rubbed some ears of grain, ate from them, and carried some away in my garment. The owner came, struck me, and took my garment. I went to the Messenger of Allah ﷺ, and he said to the man, "You did not teach him when he was ignorant, nor did you feed him when he was hungry," or he said, "starving." He ordered him to return my garment to me, and he gave me a wasq, or half a wasq, of food.

Azami 5482

Sahih

عن عباد بن شرحبيل قال

أصابني سنة، فدخلت حائطا من حيطان المدينة، ففركت سنبلا، فأكلت، وحملت في ثوبي، فجاء صاحبه، فضربني، وأخذ ثوبي، فأتيت رسول الله ﷺ، فقال له: ما علمت إذ كان جاهلا، ولا أطعمت إذ كان جائعا أو قال: ساغبا. وأمره فرد علي ثوبي، وأعطاني وسقا، أو نصف وسق من طعام.

الأعظمي 5482صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Sales
Chapter
Rulings on sales and trade
Section
It is permissible for the wayfarer to eat dates and drink milk when passing by them
Numbering
Jami al-Kamil 5482 (2nd edition)
Azami 5482