version 0.3.21
[fms.git] / src / freenet / introductionpuzzleinserter.cpp
index cac3879..5ccb25e 100644 (file)
@@ -178,18 +178,18 @@ void IntroductionPuzzleInserter::Initialize()
 const bool IntroductionPuzzleInserter::StartInsert(const long &localidentityid)\r
 {\r
        Poco::DateTime now;\r
-       std::string idstring;\r
+       std::string idstring="";\r
        long index=0;\r
-       std::string indexstr;\r
+       std::string indexstr="";\r
        Poco::UUIDGenerator uuidgen;\r
        Poco::UUID uuid;\r
-       std::string messagebase;\r
+       std::string messagebase="";\r
        IntroductionPuzzleXML xml;\r
-       std::string encodedpuzzle;\r
-       std::string solutionstring;\r
+       std::string encodedpuzzle="";\r
+       std::string solutionstring="";\r
        FCPMessage message;\r
-       std::string xmldata;\r
-       std::string xmldatasizestr;\r
+       std::string xmldata="";\r
+       std::string xmldatasizestr="";\r
        std::string privatekey="";\r
        std::string publickey="";\r
        std::string keypart="";\r
@@ -227,6 +227,11 @@ const bool IntroductionPuzzleInserter::StartInsert(const long &localidentityid)
                Option::Instance()->Get("MessageBase",messagebase);\r
 \r
                GenerateCaptcha(encodedpuzzle,solutionstring);\r
+               if(encodedpuzzle.size()==0)\r
+               {\r
+                       m_log->fatal("IntroductionPuzzleInserter::StartInsert could not create introduction puzzle");\r
+                       return false;\r
+               }\r
 \r
                try\r
                {\r