From 6cd9906f60bff929d9c5fefcbed5f15328cb7e2b Mon Sep 17 00:00:00 2001 From: Ali Mohammad Pur Date: Tue, 1 Jun 2021 21:48:36 +0430 Subject: [PATCH] AK: Make checked division also check for divide by zero --- AK/Checked.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/AK/Checked.h b/AK/Checked.h index 0a92152162d..2dccd71fb44 100644 --- a/AK/Checked.h +++ b/AK/Checked.h @@ -190,6 +190,10 @@ public: return; } } + if (other == 0) { + m_overflow = true; + return; + } m_value /= other; }