]> granicus.if.org Git - imagemagick/commitdiff
Moved allocation after the length check.
authorDirk Lemstra <dirk@git.imagemagick.org>
Sat, 20 Jan 2018 12:13:52 +0000 (13:13 +0100)
committerDirk Lemstra <dirk@git.imagemagick.org>
Sat, 20 Jan 2018 12:13:52 +0000 (13:13 +0100)
MagickCore/string.c

index 046ddf5633c149632f0e72bf2563e29dbcfa8009..4fd498dd323f90ccc042f91eb6ac7fbcab07c47a 100644 (file)
@@ -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+