Commit b8e67ed5f for imagemagick.org
commit b8e67ed5f68fc874495167a6536d3e74ab326f49
Author: Cristy <urban-warrior@imagemagick.org>
Date: Mon Nov 16 16:40:44 2026 -0500
https://github.com/ImageMagick/ImageMagick/security/advisories/GHSA-vv46-hfqg-834x
diff --git a/coders/miff.c b/coders/miff.c
index 27341dc25..cfaf8e8aa 100644
--- a/coders/miff.c
+++ b/coders/miff.c
@@ -947,6 +947,14 @@ static Image *ReadMIFFImage(const ImageInfo *image_info,
{
if (profiles == (LinkedListInfo *) NULL)
profiles=NewLinkedList(0);
+ if (GetNumberOfElementsInLinkedList(profiles) >= GetMaxProfileCount())
+ {
+ options=DestroyString(options);
+ profiles=DestroyLinkedList(profiles,
+ RelinquishMagickMemory);
+ ThrowReaderException(ResourceLimitError,
+ "TooManyProfiles");
+ }
(void) AppendValueToLinkedList(profiles,
AcquireString(options));
break;
diff --git a/coders/mpc.c b/coders/mpc.c
index 105f25789..7c02c3d80 100644
--- a/coders/mpc.c
+++ b/coders/mpc.c
@@ -638,6 +638,14 @@ static Image *ReadMPCImage(const ImageInfo *image_info,ExceptionInfo *exception)
{
if (profiles == (LinkedListInfo *) NULL)
profiles=NewLinkedList(0);
+ if (GetNumberOfElementsInLinkedList(profiles) >= GetMaxProfileCount())
+ {
+ options=DestroyString(options);
+ profiles=DestroyLinkedList(profiles,
+ RelinquishMagickMemory);
+ ThrowReaderException(ResourceLimitError,
+ "TooManyProfiles");
+ }
(void) AppendValueToLinkedList(profiles,
AcquireString(options));
break;