From: Dirk Lemstra Date: Sat, 20 Jan 2018 12:13:52 +0000 (+0100) Subject: Moved allocation after the length check. X-Git-Tag: 7.0.7-22~28 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0bb270c25474c3d58d3739f0304f7345e0250216;p=imagemagick Moved allocation after the length check. --- 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+