Changeset 18832 for trunk/FACT++/src


Ignore:
Timestamp:
04/14/17 20:56:46 (8 years ago)
Author:
tbretz
Message:
Make sure the server does not see itself. This can lead to crashes from the console if it talks to itself. Secured Tools::Split against exceptions from boost::tokenize
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/src/StateMachineDimControl.cc

    r18425 r18832  
    9393    string opt(imp.GetString());
    9494
    95     const map<string,string> data = Tools::Split(opt, true);
     95    map<string,string> data;
     96    try
     97    {
     98        data = Tools::Split(opt, true);
     99    }
     100    catch (const exception &e)
     101    {
     102        Warn("DIM_CONTROL/START: Parsing failed: "+opt+" ["+string(e.what())+"]");
     103        return GetCurrentState();
     104    }
     105
    96106    if (imp.GetSize()==0 || opt.size()==0 || opt[0]==0)
    97107    {
    98         Error("File name missing in DIM_CONTROL/START");
     108        Error("DIM_CONTROL/START: File name missing.");
    99109        return GetCurrentState();
    100110    }
     
    394404int StateMachineDimControl::HandleServerAdd(const string &server)
    395405{
     406    if (fIsServer && server=="DIM_CONTROL")
     407        return GetCurrentState();
     408
    396409    if (server!="DIS_DNS")
    397410    {
Note: See TracChangeset for help on using the changeset viewer.