From: Dirk Lemstra Date: Sun, 2 Jun 2019 13:05:00 +0000 (+0200) Subject: Added extra check to make sure an 8.3 alias for the file name exists. X-Git-Tag: 7.0.8-49~13 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=be5fd4a933f0217378347a2eeccf615a30433649;p=imagemagick Added extra check to make sure an 8.3 alias for the file name exists. --- diff --git a/MagickCore/utility-private.h b/MagickCore/utility-private.h index 28c727d10..953290bd2 100644 --- a/MagickCore/utility-private.h +++ b/MagickCore/utility-private.h @@ -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);