From: Gunnar Beutner Date: Mon, 15 Jun 2015 12:04:38 +0000 (+0200) Subject: Fix unexpected exception in Utility::DirName when specifying an empty path X-Git-Tag: v2.3.5~11 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=faf0865a94b424f694cf6e3a8f07604d83abb77a;p=icinga2 Fix unexpected exception in Utility::DirName when specifying an empty path refs #9263 --- diff --git a/lib/base/utility.cpp b/lib/base/utility.cpp index 5fdf25468..6287920aa 100644 --- a/lib/base/utility.cpp +++ b/lib/base/utility.cpp @@ -175,7 +175,7 @@ String Utility::DirName(const String& path) #ifndef _WIN32 result = dirname(dir); #else /* _WIN32 */ - if (!PathRemoveFileSpec(dir)) { + if (dir[0] != 0 && !PathRemoveFileSpec(dir)) { free(dir); BOOST_THROW_EXCEPTION(win32_error()