From 191566fc97ea92555c2f6e5b191c990ec2c905fa Mon Sep 17 00:00:00 2001 From: Emanuele Torre Date: Sat, 22 Jan 2022 02:35:24 +0100 Subject: [PATCH] LibJS: Avoid potential signed integer overflow in CyclicModule.cpp `auto count = 0;` will declare `count` as a `signed int`. We don't want that since `count` is used to count the occurence of an element in an `AK::Vector` that can have up to `SIZE_MAX` elements; `SIZE_MAX` can overflow a `signed int` more than 4 billion times. --- Userland/Libraries/LibJS/CyclicModule.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Libraries/LibJS/CyclicModule.cpp b/Userland/Libraries/LibJS/CyclicModule.cpp index 529b942956..9650222997 100644 --- a/Userland/Libraries/LibJS/CyclicModule.cpp +++ b/Userland/Libraries/LibJS/CyclicModule.cpp @@ -126,7 +126,7 @@ ThrowCompletionOr CyclicModule::inner_module_linking(VM& vm, Vector