Al-Ilmam bi-Ahadith al-Ahkam 245
وَرَوَى مَالك، عَن بُسر بن سعيد أَن زيد بن خَالِد أرْسلهُ إِلَى أبي جُهيم يسْأَله مَاذَا سمع من رَسُول الله ﷺ فِي المارّ بَين يَدي الْمُصَلِّي مَاذَا عَلَيْهِ من الْإِثْم فَقَالَ أَبُو جُهيم: قَالَ رَسُول الله ﷺ : " لَو يعلم المارّ بَين يَدي الْمُصَلِّي مَاذَا عَلَيْهِ من الْإِثْم لَكَانَ أَن يقف أَرْبَعِينَ خيرا من أَن يمر بَين يَدَيْهِ ". قَالَ أَبُو النَّضر: لَا أَدْرِي أَرْبَعِينَ يَوْمًا، أَو شهرا، أَو سنة. مُتَّفق عَلَيْهِمَا وَاللَّفْظ للْبُخَارِيّ.
And Malik narrated, from Busr ibn Saʿid, that Zayd ibn Khalid sent him to Abu Juhaym to ask him what he had heard from the Messenger of Allah ﷺ about the one who passes in front of a person praying, and what sin is upon him. Abu Juhaym said: The Messenger of Allah ﷺ said: "If the one who passes in front of a person praying knew what [sin] is upon him, it would be better for him to stand for forty than to pass in front of him." Abu an-Nadr said: I do not know whether he said forty days, or months, or years. Both are agreed upon, and the wording is al-Bukhari's.