File ImageMagick-CVE-2026-25795.patch of Package ImageMagick.42998

From 0c7d0b9671ae2616fca106dcada45536eb4df5dc Mon Sep 17 00:00:00 2001
From: Dirk Lemstra <dirk@lemstra.org>
Date: Fri, 6 Feb 2026 21:16:10 +0100
Subject: [PATCH] Fixed NULL pointer dereference in ReadSFWImage
 (GHSA-p33r-fqw2-rqmm)

---
 coders/sfw.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/coders/sfw.c b/coders/sfw.c
index f7ab1ef10ec..cc5fcedc6f4 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);

openSUSE Build Service is sponsored by