From 0bb270c25474c3d58d3739f0304f7345e0250216 Mon Sep 17 00:00:00 2001 From: Dirk Lemstra Date: Sat, 20 Jan 2018 13:13:52 +0100 Subject: [PATCH] Moved allocation after the length check. --- MagickCore/string.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MagickCore/string.c b/MagickCore/string.c index 046ddf563..4fd498dd3 100644 --- a/MagickCore/string.c +++ b/MagickCore/string.c @@ -215,9 +215,9 @@ MagickExport StringInfo *BlobToStringInfo(const void *blob,const size_t length) StringInfo *string_info; - string_info=AcquireStringInfo(0); if (~length < MagickPathExtent) ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed"); + string_info=AcquireStringInfo(0); string_info->length=length; if (string_info->datum == (unsigned char *) NULL) string_info->datum=(unsigned char *) AcquireQuantumMemory(length+ -- 2.40.0