كتاب الحج
15  
The Book of Pilgrimage
(74)
Chapter: A woman travelling with a Mahram for Hajj and other purposes
(74)
باب سَفَرِ الْمَرْأَةِ مَعَ مَحْرَمٍ إِلَى حَجٍّ وَغَيْرِهِ ‏‏
Sahih Muslim 1338 b

This hadith has been narrated on the same authority by Ubaidullah. And in the narration of Abu Bakr (the words are):

" More than three (days)." Ibn Numair narrated on the authority of his father, (and the words are):" Three (days) except (when) she has a Mahram with her."
وَحَدَّثَنَا أَبُو بَكْرِ بْنُ أَبِي شَيْبَةَ، حَدَّثَنَا عَبْدُ اللَّهِ بْنُ نُمَيْرٍ، وَأَبُو أُسَامَةَ ح وَحَدَّثَنَا ابْنُ نُمَيْرٍ، حَدَّثَنَا أَبِي جَمِيعًا، عَنْ عُبَيْدِ اللَّهِ، بِهَذَا الإِسْنَادِ ‏.‏ فِي رِوَايَةِ أَبِي بَكْرٍ فَوْقَ ثَلاَثٍ ‏.‏ وَقَالَ ابْنُ نُمَيْرٍ فِي رِوَايَتِهِ عَنْ أَبِيهِ، ‏ "‏ ثَلاَثَةً إِلاَّ وَمَعَهَا ذُو مَحْرَمٍ ‏"‏ ‏.‏
Reference : Sahih Muslim 1338b
In-book reference : Book 15, Hadith 463
USC-MSA web (English) reference : Book 7, Hadith 3097
  (deprecated numbering scheme)