From be5fd4a933f0217378347a2eeccf615a30433649 Mon Sep 17 00:00:00 2001 From: Dirk Lemstra Date: Sun, 2 Jun 2019 15:05:00 +0200 Subject: [PATCH] Added extra check to make sure an 8.3 alias for the file name exists. --- MagickCore/utility-private.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); -- 2.40.0