]> granicus.if.org Git - icinga2/commitdiff
Fix unexpected exception in Utility::DirName when specifying an empty path
authorGunnar Beutner <gunnar@beutner.name>
Mon, 15 Jun 2015 12:04:38 +0000 (14:04 +0200)
committerGunnar Beutner <gunnar@beutner.name>
Mon, 15 Jun 2015 12:04:38 +0000 (14:04 +0200)
refs #9263

lib/base/utility.cpp

index dd240a64da39c0435c627f23b0a7c05edbe1bcd6..b035676320ecc8a899f3bc4854eca717d47df003 100644 (file)
@@ -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()