From 349047e3b61ec8050c195954e6eb9fd32428cf09 Mon Sep 17 00:00:00 2001 From: Joakim Plate Date: Thu, 1 Jun 2023 11:08:56 +0200 Subject: [PATCH] Avoid stack overflow in CreateDirectoriesRecursively Fixes #4262 --- googletest/src/gtest-filepath.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/googletest/src/gtest-filepath.cc b/googletest/src/gtest-filepath.cc index 9d79ea49d8..6245827297 100644 --- a/googletest/src/gtest-filepath.cc +++ b/googletest/src/gtest-filepath.cc @@ -334,7 +334,7 @@ bool FilePath::CreateDirectoriesRecursively() const { return false; } - if (pathname_.length() == 0 || this->DirectoryExists()) { + if (pathname_.length() == 0 || pathname_ == kCurrentDirectoryString || this->DirectoryExists()) { return true; }