كتاب الصيام
13  
The Book of Fasting
(2)
Chapter: The obligation to fast Ramadan when the crescent is sighted, and to break the fast when the crescent is sighted, and that if it is cloudy at the beginning or end of the month, then the month should be completed as thirty days.
(2)
بَاب وُجُوبِ صَوْمِ رَمَضَانَ لِرُؤْيَةِ الْهِلَالِ وَالْفِطْرِ لِرُؤْيَةِ الْهِلَالِ وَأَنَّهُ إِذَا غُمَّ فِي أَوَّلِهِ أَوْ آخِرِهِ أُكْمِلَتْ عِدَّةُ الشَّهْرِ ثَلَاثِينَ يَوْمًا
Sahih Muslim 1080 c

This hadith is narrated on the authority of 'Ubaidullah with the same chain of transmitters, and he said:

If (the sky) is cloudy for you, then calculate thirty days (for the month of Ramadan).
وَحَدَّثَنَا ابْنُ نُمَيْرٍ، حَدَّثَنَا أَبِي، حَدَّثَنَا عُبَيْدُ اللَّهِ، بِهَذَا الإِسْنَادِ وَقَالَ ‏ "‏ فَإِنْ غُمَّ عَلَيْكُمْ فَاقْدِرُوا ثَلاَثِينَ ‏"‏ ‏.‏ نَحْوَ حَدِيثِ أَبِي أُسَامَةَ ‏.‏
Reference : Sahih Muslim 1080c
In-book reference : Book 13, Hadith 6
USC-MSA web (English) reference : Book 6, Hadith 2365
  (deprecated numbering scheme)