Abu Hurairah reported,

The Prophet ﷺ said, "A man bought a piece of land from another man, and the buyer found a jar of gold buried in it. The buyer said to the seller, 'Take your gold from me. I only bought the land from you, not the gold.'The owner of the land replied, 'I sold you the land and whatever is in it.'So the two of them brought their dispute to another man, who asked them, 'Do you have any children?'One of them said, 'I have a son.'The other said, 'I have a daughter.'He said, 'Marry the boy to the Jariya, spend from this gold on the two of them, and give some in charity.'"

Bukhari 3472

Sahih

حدثنا إسحاق بن نصر أخبرنا عبد الرزاق عن معمر عن همام

عن أبي هريرة رضي الله عنه قال

قال النبي ﷺ اشترى رجل من رجل عقارا له فوجد الرجل الذي اشترى العقار في عقاره جرة فيها ذهب فقال له الذي اشترى العقار خذ ذهبك مني إنما اشتريت منك الأرض ولم أبتع منك الذهب وقال الذي له الأرض إنما بعتك الأرض وما فيها فتحاكما إلى رجل فقال الذي تحاكما إليه ألكما ولد قال أحدهما لي غلام وقال الآخر لي جارية قال أنكحوا الغلام الجارية وأنفقوا على أنفسهما منه وتصدقا

البخاري 3472صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Bukhari
Book
Hadiths of the prophets
Chapter
Hadith of the cave
Numbering
Darussalam 3472
Bukhari 3472