Fix Coverity
authorakisiel <akisiel@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 16 Dec 2011 13:53:56 +0000 (13:53 +0000)
committerakisiel <akisiel@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 16 Dec 2011 13:53:56 +0000 (13:53 +0000)
TTherminator/Therminator/Parser.cxx

index cc1fdb0..b3b30ba 100644 (file)
@@ -410,9 +410,13 @@ void Parser::ReadInput()
          char *tLBrackert, *tFirstComma, *tSecondComma, *tThirdComma, *tRBracket;
          
          tLBrackert = strchr(str,'[');
+         if (!tLBrackert) exit(0);
          tFirstComma = strchr(str,',');
+         if (!tFirstComma) exit(0);
          tSecondComma = strchr(tFirstComma+1,',');
+         if (!tSecondComma) exit(0);
          tThirdComma = strchr(tSecondComma+1,',');
+         if (!tThirdComma) exit(0);
          tRBracket = strchr(tThirdComma,']');
          if (!(tLBrackert && tFirstComma && tSecondComma && tThirdComma && tRBracket))
            PRINT_DEBUG_1("Malformed line!: " << str);