diff options
Diffstat (limited to 'src/utils/mkdir.cpp')
-rw-r--r-- | src/utils/mkdir.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/utils/mkdir.cpp b/src/utils/mkdir.cpp index 4632bec84..f73af6db5 100644 --- a/src/utils/mkdir.cpp +++ b/src/utils/mkdir.cpp @@ -54,6 +54,9 @@ int mkdir_r(const char *pathname) int len = static_cast<int>(strlen(tmp)); + if (len < 1) + return -1; + // terminate the pathname with '/' if (tmp[len - 1] != '/') { |