]> granicus.if.org Git - icinga2/commitdiff
cluster: Handle non-numeric log file names.
authorGunnar Beutner <gunnar.beutner@netways.de>
Tue, 3 Sep 2013 08:32:42 +0000 (10:32 +0200)
committerGunnar Beutner <gunnar.beutner@netways.de>
Tue, 3 Sep 2013 08:33:22 +0000 (10:33 +0200)
components/cluster/clustercomponent.cpp

index f4229af1fc41b8d970074cdd725af90a3acf515e..aa704c8952ca1c777be77115347a3dd54cc56169 100644 (file)
@@ -276,7 +276,15 @@ void ClusterComponent::CloseLogFile(void)
 void ClusterComponent::LogGlobHandler(std::vector<int>& files, const String& file)
 {
        String name = Utility::BaseName(file);
-       int ts = Convert::ToLong(name);
+
+       int ts;
+
+       try {
+               ts = Convert::ToLong(name);
+       } catch (const std::exception&) {
+               return;
+       }
+
        files.push_back(ts);
 }