]> granicus.if.org Git - imagemagick/commitdiff
Added extra check to make sure an 8.3 alias for the file name exists.
authorDirk Lemstra <dirk@lemstra.org>
Sun, 2 Jun 2019 13:05:00 +0000 (15:05 +0200)
committerDirk Lemstra <dirk@lemstra.org>
Sun, 2 Jun 2019 13:08:05 +0000 (15:08 +0200)
MagickCore/utility-private.h

index 28c727d1019b4778a419278b110252774385fcab..953290bd222b203291f61824d6739c0e05257fae 100644 (file)
@@ -86,7 +86,7 @@ static inline wchar_t *create_wchar_path(const char *utf8)
       if (count != 0)
         count=GetShortPathNameW(longPath,shortPath,MAX_PATH);
       longPath=(wchar_t *) RelinquishMagickMemory(longPath);
-      if (count < 5)
+      if ((count < 5) || (count >= MAX_PATH))
         return((wchar_t *) NULL);
       wideChar=(wchar_t *) AcquireQuantumMemory(count-3,sizeof(*wideChar));
       wcscpy(wideChar,shortPath+4);