Commit 361b42c91 for imagemagick.org
commit 361b42c91d173cfb4bd8f39898c599feef6a1e55
Author: Dirk Lemstra <dirk@lemstra.org>
Date: Fri Mar 13 09:57:46 2026 +0100
Corrected out of bounds write of a single zero byte (GHSA-gc62-2v5p-qpmp)
diff --git a/MagickCore/xml-tree.c b/MagickCore/xml-tree.c
index ba76e376d..a42626ff8 100644
--- a/MagickCore/xml-tree.c
+++ b/MagickCore/xml-tree.c
@@ -1276,7 +1276,7 @@ static char *ConvertUTF16ToUTF8(const char *content,size_t *length)
}
}
*length=(size_t) j;
- utf8=(char *) ResizeQuantumMemory(utf8,*length,sizeof(*utf8));
+ utf8=(char *) ResizeQuantumMemory(utf8,(*length+1),sizeof(*utf8));
if (utf8 != (char *) NULL)
utf8[*length]='\0';
return(utf8);