Language:
كتاب التعبير
91  
Interpretation of Dreams
(46)
Chapter: A bad dream should not be told to anybody
(46)
باب إِذَا رَأَى مَا يَكْرَهُ فَلاَ يُخْبِرْ بِهَا وَلاَ يَذْكُرْهَا
Sahih al-Bukhari 7045

Narrated Abu Sa`id Al-Khudri:

I heard Allah's Messenger (ﷺ) saying, "If anyone of you saw a dream which he liked, then that was from Allah, and he should thank Allah for it and tell it to others; but if he saw something else, i.e, a dream which he did not like, then that is from Satan and he should seek refuge with Allah from it and should not tell it to anybody for it will not harm him."

حَدَّثَنَا إِبْرَاهِيمُ بْنُ حَمْزَةَ، حَدَّثَنِي ابْنُ أَبِي حَازِمٍ، وَالدَّرَاوَرْدِيُّ، عَنْ يَزِيدَ، عَنْ عَبْدِ اللَّهِ بْنِ خَبَّابٍ، عَنْ أَبِي سَعِيدٍ الْخُدْرِيِّ، أَنَّهُ سَمِعَ رَسُولَ اللَّهِ صلى الله عليه وسلم يَقُولُ ‏ "‏ إِذَا رَأَى أَحَدُكُمُ الرُّؤْيَا يُحِبُّهَا، فَإِنَّهَا مِنَ اللَّهِ، فَلْيَحْمَدِ اللَّهَ عَلَيْهَا، وَلْيُحَدِّثْ بِهَا، وَإِذَا رَأَى غَيْرَ ذَلِكَ مِمَّا يَكْرَهُ، فَإِنَّمَا هِيَ مِنَ الشَّيْطَانِ، فَلْيَسْتَعِذْ مِنْ شَرِّهَا، وَلاَ يَذْكُرْهَا لأَحَدٍ، فَإِنَّهَا لَنْ تَضُرَّهُ ‏"
Reference : Sahih al-Bukhari 7045
In-book reference : Book 91, Hadith 59
USC-MSA web (English) reference : Vol. 9, Book 87, Hadith 169
  (deprecated numbering scheme)