imagemagick: patch CVE-2025-55160

Details: https://nvd.nist.gov/vuln/detail/CVE-2025-55160

Pick the commit that mentions the related github advisory in its commit message.

Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com>
This commit is contained in:
Gyorgy Sarvari
2025-10-08 22:59:11 +02:00
parent 63362396cb
commit 188c714d2a
2 changed files with 162 additions and 0 deletions

View File

@@ -0,0 +1,161 @@
From 0d03196a77a14c124c4d5c7b817c67a448251731 Mon Sep 17 00:00:00 2001
From: Cristy <urban-warrior@imagemagick.org>
Date: Sun, 10 Aug 2025 08:28:28 -0400
Subject: [PATCH] CVE-2025-55160
https://github.com/ImageMagick/ImageMagick/security/advisories/GHSA-6hgw-6x87-578x
CVE: CVE-2025-55160
Upstream-Status: Backport [https://github.com/ImageMagick/ImageMagick/commit/63d8769dd6a8f32f4096c71be9e08a2c081e47da]
Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com>
---
MagickCore/artifact.c | 17 ++++++++++++++++-
MagickCore/option.c | 17 ++++++++++++++++-
MagickCore/profile.c | 19 ++++++++++++++++++-
MagickCore/property.c | 18 ++++++++++++++++--
4 files changed, 66 insertions(+), 5 deletions(-)
diff --git a/MagickCore/artifact.c b/MagickCore/artifact.c
index dae6aaaf0..764ef75a4 100644
--- a/MagickCore/artifact.c
+++ b/MagickCore/artifact.c
@@ -99,6 +99,21 @@
% o clone_image: the source image for artifacts to clone.
%
*/
+
+typedef char
+ *(*CloneKeyFunc)(const char *),
+ *(*CloneValueFunc)(const char *);
+
+static inline void *CloneArtifactKey(void *key)
+{
+ return((void *) ((CloneKeyFunc) ConstantString)((const char *) key));
+}
+
+static inline void *CloneArtifactValue(void *value)
+{
+ return((void *) ((CloneValueFunc) ConstantString)((const char *) value));
+}
+
MagickExport MagickBooleanType CloneImageArtifacts(Image *image,
const Image *clone_image)
{
@@ -117,7 +132,7 @@ MagickExport MagickBooleanType CloneImageArtifacts(Image *image,
if (image->artifacts != (void *) NULL)
DestroyImageArtifacts(image);
image->artifacts=CloneSplayTree((SplayTreeInfo *) clone_image->artifacts,
- (void *(*)(void *)) ConstantString,(void *(*)(void *)) ConstantString);
+ CloneArtifactKey,CloneArtifactValue);
}
return(MagickTrue);
}
diff --git a/MagickCore/option.c b/MagickCore/option.c
index 6774334d3..e60cd878b 100644
--- a/MagickCore/option.c
+++ b/MagickCore/option.c
@@ -2358,6 +2358,21 @@ static const OptionInfo
% o clone_info: the source image info for options to clone.
%
*/
+
+typedef char
+ *(*CloneKeyFunc)(const char *),
+ *(*CloneValueFunc)(const char *);
+
+static inline void *CloneOptionKey(void *key)
+{
+ return((void *) ((CloneKeyFunc) ConstantString)((const char *) key));
+}
+
+static inline void *CloneOptionValue(void *value)
+{
+ return((void *) ((CloneValueFunc) ConstantString)((const char *) value));
+}
+
MagickExport MagickBooleanType CloneImageOptions(ImageInfo *image_info,
const ImageInfo *clone_info)
{
@@ -2373,7 +2388,7 @@ MagickExport MagickBooleanType CloneImageOptions(ImageInfo *image_info,
if (image_info->options != (void *) NULL)
DestroyImageOptions(image_info);
image_info->options=CloneSplayTree((SplayTreeInfo *) clone_info->options,
- (void *(*)(void *)) ConstantString,(void *(*)(void *)) ConstantString);
+ CloneOptionKey,CloneOptionValue);
}
return(MagickTrue);
}
diff --git a/MagickCore/profile.c b/MagickCore/profile.c
index a68e54f14..e131bd6ec 100644
--- a/MagickCore/profile.c
+++ b/MagickCore/profile.c
@@ -143,6 +143,23 @@ typedef struct _CMSExceptionInfo
% o clone_image: the clone image.
%
*/
+
+typedef char
+ *(*CloneKeyFunc)(const char *);
+
+typedef StringInfo
+ *(*CloneValueFunc)(const StringInfo *);
+
+static inline void *CloneProfileKey(void *key)
+{
+ return((void *) ((CloneKeyFunc) ConstantString)((const char *) key));
+}
+
+static inline void *CloneProfileValue(void *value)
+{
+ return((void *) ((CloneValueFunc) CloneStringInfo)((const StringInfo *) value));
+}
+
MagickExport MagickBooleanType CloneImageProfiles(Image *image,
const Image *clone_image)
{
@@ -157,7 +174,7 @@ MagickExport MagickBooleanType CloneImageProfiles(Image *image,
if (image->profiles != (void *) NULL)
DestroyImageProfiles(image);
image->profiles=CloneSplayTree((SplayTreeInfo *) clone_image->profiles,
- (void *(*)(void *)) ConstantString,(void *(*)(void *)) CloneStringInfo);
+ CloneProfileKey,CloneProfileValue);
}
return(MagickTrue);
}
diff --git a/MagickCore/property.c b/MagickCore/property.c
index 1d9e50184..8a6727de4 100644
--- a/MagickCore/property.c
+++ b/MagickCore/property.c
@@ -131,6 +131,21 @@
% o clone_image: the clone image.
%
*/
+
+typedef char
+ *(*CloneKeyFunc)(const char *),
+ *(*CloneValueFunc)(const char *);
+
+static inline void *ClonePropertyKey(void *key)
+{
+ return((void *) ((CloneKeyFunc) ConstantString)((const char *) key));
+}
+
+static inline void *ClonePropertyValue(void *value)
+{
+ return((void *) ((CloneValueFunc) ConstantString)((const char *) value));
+}
+
MagickExport MagickBooleanType CloneImageProperties(Image *image,
const Image *clone_image)
{
@@ -195,8 +210,7 @@ MagickExport MagickBooleanType CloneImageProperties(Image *image,
if (image->properties != (void *) NULL)
DestroyImageProperties(image);
image->properties=CloneSplayTree((SplayTreeInfo *)
- clone_image->properties,(void *(*)(void *)) ConstantString,
- (void *(*)(void *)) ConstantString);
+ clone_image->properties,ClonePropertyKey,ClonePropertyValue);
}
return(MagickTrue);
}

View File

@@ -21,6 +21,7 @@ SRC_URI = "git://github.com/ImageMagick/ImageMagick.git;branch=main;protocol=htt
file://0001-CVE-2025-55004.patch \
file://0001-CVE-2025-55005.patch \
file://0001-CVE-2025-55154.patch \
file://0001-CVE-2025-55160.patch \
"
SRCREV = "a2d96f40e707ba54b57e7d98c3277d3ea6611ace"