كتاب المقدمات
The Book of Miscellany
(11)
Chapter: The Struggle (in the Cause of Allah)
(11)
- باب المجاهدة
Riyad as-Salihin 103
Ibn Mas'ud (May Allah be pleased with him) said:
One night I joined the Prophet (ﷺ) in his (optional) Salat. He prolonged the standing so much that I thought of doing something evil. He was asked: "What did you intend to do?" He replied: "To sit down and leave him".

[Al-Bukhari and Muslim].

التاسع‏:‏ عن ابن مسعود رضي الله عنه قال‏:‏ صليت مع النبي صلى الله عليه وسلم ليلة، فأطال القيام حتى هممت بأمر سوء‏!‏ قيل‏:‏ وما هممت به‏؟‏
قال‏:‏ هممت أن أجلس وأدعه‏.‏ ‏(‏‏(‏متفق عليه‏)‏‏)‏‏.‏
Reference : Riyad as-Salihin 103
In-book reference : Introduction, Hadith 103