Commit 0c7d0b967 for imagemagick.org
commit 0c7d0b9671ae2616fca106dcada45536eb4df5dc
Author: Dirk Lemstra <dirk@lemstra.org>
Date: Fri Feb 6 21:16:10 2026 +0100
Fixed NULL pointer dereference in ReadSFWImage (GHSA-p33r-fqw2-rqmm)
diff --git a/coders/sfw.c b/coders/sfw.c
index f7ab1ef10..cc5fcedc6 100644
--- a/coders/sfw.c
+++ b/coders/sfw.c
@@ -317,9 +317,9 @@ static Image *ReadSFWImage(const ImageInfo *image_info,ExceptionInfo *exception)
if ((unique_file == -1) || (file == (FILE *) NULL))
{
buffer=(unsigned char *) RelinquishMagickMemory(buffer);
- read_info=DestroyImageInfo(read_info);
(void) CopyMagickString(image->filename,read_info->filename,
MagickPathExtent);
+ read_info=DestroyImageInfo(read_info);
ThrowFileException(exception,FileOpenError,"UnableToCreateTemporaryFile",
image->filename);
image=DestroyImageList(image);