Fixed bug when receiving invalid whiteboard data.
This commit is contained in:
parent
a99d71bb36
commit
e186e833ea
1 changed files with 8 additions and 6 deletions
|
@ -701,6 +701,13 @@ void side_actions::execute_net_cmd(net_cmd const& cmd)
|
|||
{
|
||||
size_t turn = cmd["turn"].to_int();
|
||||
size_t pos = cmd["pos"].to_int();
|
||||
action_ptr act = action::from_config(cmd.child("action"),hidden_);
|
||||
if(!act)
|
||||
{
|
||||
ERR_WB << "side_actions::execute_network_command(): received invalid action data!\n";
|
||||
return;
|
||||
}
|
||||
|
||||
if(turn >= actions_.size()
|
||||
|| pos >= actions_[turn].size())
|
||||
{
|
||||
|
@ -709,12 +716,7 @@ void side_actions::execute_net_cmd(net_cmd const& cmd)
|
|||
}
|
||||
|
||||
iterator itor = turn_begin(turn)+pos;
|
||||
try {
|
||||
itor = raw_insert(itor,action::from_config(cmd.child("action"),hidden_));
|
||||
} catch(action::ctor_err const&) {
|
||||
ERR_WB << "side_actions::execute_network_command(): received invalid data!\n";
|
||||
return;
|
||||
}
|
||||
itor = raw_insert(itor,act);
|
||||
safe_erase(++itor);
|
||||
}
|
||||
else if(type=="remove")
|
||||
|
|
Loading…
Add table
Reference in a new issue