summaryrefslogtreecommitdiff
path: root/Kernel
diff options
context:
space:
mode:
authorMuhammad Zahalqa <m@tryfinally.com>2020-08-02 22:10:35 +0300
committerGitHub <noreply@github.com>2020-08-02 21:10:35 +0200
commit615ba0f368d5012c7507a10086a54d1fcdb1fbc0 (patch)
treec0ebb8862236bf0dc4f07261bb3bd4518567f828 /Kernel
parent2242f69cd625310ddf7ee4d3bcad5e7070819516 (diff)
downloadserenity-615ba0f368d5012c7507a10086a54d1fcdb1fbc0.zip
AK: Fix overflow and mixed-signedness issues in binary_search() (#2961)
Diffstat (limited to 'Kernel')
-rw-r--r--Kernel/VM/RangeAllocator.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Kernel/VM/RangeAllocator.cpp b/Kernel/VM/RangeAllocator.cpp
index 0ea151d07c..3f79f46db8 100644
--- a/Kernel/VM/RangeAllocator.cpp
+++ b/Kernel/VM/RangeAllocator.cpp
@@ -172,7 +172,7 @@ void RangeAllocator::deallocate(Range range)
ASSERT(!m_available_ranges.is_empty());
- int nearby_index = 0;
+ size_t nearby_index = 0;
auto* existing_range = binary_search(
m_available_ranges.span(), range, [](auto& a, auto& b) {
return a.base().get() - b.end().get();