Sayyiduna Ibn Abbas (may Allah be pleased with them both) said: The Messenger of Allah (peace and blessings be upon him) came to Madinah at a time when the people of Madinah used to pay the price of fruits in advance for two or three years. So the Messenger of Allah (peace and blessings be upon him) said: "When paying the price of fruits in advance, make sure the measure, weight, and quantity are known and specified."
Sufyan (may Allah have mercy on him) used to mention for a time «إلی أجل معلوم» (that is, the period should also be specified), then Abdullah bin Kathir caused him to doubt about it.