1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
|
From: Cristy <urban-warrior@imagemagick.org>
Date: Tue, 23 Apr 2024 11:39:48 -0400
Subject: use >= instead to work around precision limitations of a double.
This is needed for fixing CVE-2023-34151
Cast from double to integer is hard to correctly and was fixed by a few patches upstream.
origin: https://github.com/ImageMagick/ImageMagick6/commit/3252d4771ff1142888ba83c439588969fcea98e4.patch
---
magick/image-private.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/magick/image-private.h b/magick/image-private.h
index 4e03993..bfe0a81 100644
--- a/magick/image-private.h
+++ b/magick/image-private.h
@@ -106,7 +106,7 @@ static inline size_t CastDoubleToUnsigned(const double x)
return(0);
}
value=floor(x);
- if (value > ((double) MAGICK_SIZE_MAX))
+ if (value >= ((double) MAGICK_SIZE_MAX))
{
errno=ERANGE;
return((size_t) MAGICK_SIZE_MAX);
|