عَنِ ابْنِ عُمَرَ قَالَ: قَالَ رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ: «مَنِ ابْتَاعَ نَخْلًا بَعْدَ أَنْ تُؤَبَّرَ فَثَمَرَتُهَا لِلْبَائِعِ إِلَّا أَنْ يَشْتَرِطَ الْمُبْتَاعُ وَمَنِ ابْتَاعَ عَبْدًا وَلَهُ مَالٌ فَمَالُهُ لِلْبَائِعِ إِلَّا أَنْ يَشْتَرِطَ الْمُبْتَاعُ» . رَوَاهُ مُسلم وروى البُخَارِيّ الْمَعْنى الأول وَحده

Ibn ‘Umar reported God’s Messenger as saying, “If anyone buys palm-trees after they have been fecundated the fruit belongs to the seller unless the buyer makes a proviso; and if anyone buys a slave who possesses property his property belongs to the seller unless the buyer makes a proviso."

Muslim transmitted it and Bukhari transmitted something to the same effect as the first part alone.

See also hadith 45716.