Language:
كتاب الجنائز
23  
Funerals (Al-Janaa'iz)
(1)
Chapter: What is said about funerals, and those whose last words were: La ilãha ilallãh (none has the right to be worshipped but Allah)
(1)
باب فِي الْجَنَائِزِ وَمَنْ كَانَ آخِرُ كَلاَمِهِ لاَ إِلَهَ إِلاَّ اللَّهُ
Sahih al-Bukhari 1237

Narrated Abu Dhar:

Allah's Messenger (ﷺ) said, "Someone came to me from my Lord and gave me the news (or good tidings) that if any of my followers dies worshipping none (in any way) along with Allah, he will enter Paradise." I asked, "Even if he committed illegal sexual intercourse (adultery) and theft?" He replied, "Even if he committed illegal sexual intercourse (adultery) and theft."

حَدَّثَنَا مُوسَى بْنُ إِسْمَاعِيلَ، حَدَّثَنَا مَهْدِيُّ بْنُ مَيْمُونٍ، حَدَّثَنَا وَاصِلٌ الأَحْدَبُ، عَنِ الْمَعْرُورِ بْنِ سُوَيْدٍ، عَنْ أَبِي ذَرٍّ ـ رضى الله عنه ـ قَالَ قَالَ رَسُولُ اللَّهِ صلى الله عليه وسلم ‏"‏ أَتَانِي آتٍ مِنْ رَبِّي فَأَخْبَرَنِي ـ أَوْ قَالَ بَشَّرَنِي ـ أَنَّهُ مَنْ مَاتَ مِنْ أُمَّتِي لاَ يُشْرِكُ بِاللَّهِ شَيْئًا دَخَلَ الْجَنَّةَ ‏"‏‏.‏ قُلْتُ وَإِنْ زَنَى وَإِنْ سَرَقَ قَالَ ‏"‏ وَإِنْ زَنَى وَإِنْ سَرَقَ ‏"‏‏.‏
Reference : Sahih al-Bukhari 1237
In-book reference : Book 23, Hadith 1
USC-MSA web (English) reference : Vol. 2, Book 23, Hadith 329
  (deprecated numbering scheme)