Index: test/support/platform_support.h =================================================================== --- test/support/platform_support.h +++ test/support/platform_support.h @@ -53,7 +53,7 @@ #include #include #if defined(_WIN32) || defined(__MINGW32__) -#include // _mktemp +#include // _mktemp_s #else #include // close #endif @@ -71,11 +71,13 @@ get_temp_file_name() { #if defined(_WIN32) || defined(__MINGW32__) - char Path[MAX_PATH+1]; - char FN[MAX_PATH+1]; - do { } while (0 == GetTempPath(MAX_PATH+1, Path)); - do { } while (0 == GetTempFileName(Path, "libcxx", 0, FN)); - return FN; + char Name[] = "libcxx.XXXXXX"; + + if (_mktemp_s(Name, sizeof(Name)) != 0) { + abort(); + } + + return Name; #else std::string Name; int FD = -1;