From d0805db3d075ba0db303d3255069e1ca3774e9c4 Mon Sep 17 00:00:00 2001 From: Jamie Vital Date: Tue, 17 Oct 2023 14:06:02 -0400 Subject: [PATCH] Fix crash in goesproc when an absolute path is used --- src/util/fs.cc | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/util/fs.cc b/src/util/fs.cc index 22c1a824..404aee20 100644 --- a/src/util/fs.cc +++ b/src/util/fs.cc @@ -20,11 +20,15 @@ void mkdirp(const std::string& path) { continue; } auto sub = path.substr(0, pos); - auto rv = _mkdir(sub.c_str()); - if (rv == -1 && errno != EEXIST) { - perror("mkdir"); - ASSERT(rv == 0); + if (sub.back() != ':') + { + auto rv = _mkdir(sub.c_str()); + if (rv == -1 && errno != EEXIST) { + perror("mkdir"); + ASSERT(rv == 0); + } } + if (pos == std::string::npos) { break; }