From 134717ec8fc5bb62e43458bf81cd67c15479f0d5 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sat, 6 May 2023 15:46:11 +0200 Subject: [PATCH] LibWeb: VERIFY that nobody tries to hash a non-finite CSSPixels value Non-finite CSSPixels quantities should never make their way into hash tables. If this ever happens, let's catch it closer to the source instead of letting things cascade into confusion. --- Userland/Libraries/LibWeb/PixelUnits.h | 1 + 1 file changed, 1 insertion(+) diff --git a/Userland/Libraries/LibWeb/PixelUnits.h b/Userland/Libraries/LibWeb/PixelUnits.h index ac40f9a947..f2fed528d2 100644 --- a/Userland/Libraries/LibWeb/PixelUnits.h +++ b/Userland/Libraries/LibWeb/PixelUnits.h @@ -127,6 +127,7 @@ template<> struct Traits : public GenericTraits { static unsigned hash(Web::CSSPixels const& key) { + VERIFY(isfinite(key.value())); return Traits::hash(key.value()); }