Sayyiduna Abu Hurayrah (may Allah be pleased with him) narrated that the Prophet (peace and blessings be upon him) said: "Whoever swears an oath that binds him (to something) while he is lying in it, let him prepare to take his place in Hell."
Al-Tabarani recorded it in al-Mu'jam al-Awsat; its chain contains Muhammad bin Abdullah bin Ulathah, whom Yahya bin Ma'in declared thiqah (trustworthy) and others declared da'if (weak), but declaring him weak has been rejected.