diff options
Diffstat (limited to 'src/modules/m_spanningtree')
-rw-r--r-- | src/modules/m_spanningtree/addline.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/modules/m_spanningtree/addline.cpp b/src/modules/m_spanningtree/addline.cpp index 7ee1a7ef1..16043b2aa 100644 --- a/src/modules/m_spanningtree/addline.cpp +++ b/src/modules/m_spanningtree/addline.cpp @@ -54,17 +54,21 @@ bool TreeSocket::AddLine(const std::string &prefix, parameterlist ¶ms) return true; } + long created = atol(params[3].c_str()), expires = atol(params[4].c_str()); + if (created < 0 || expires < 0) + return true; + XLine* xl = NULL; try { - xl = xlf->Generate(ServerInstance->Time(), atoi(params[4].c_str()), params[2], params[5], params[1]); + xl = xlf->Generate(ServerInstance->Time(), expires, params[2], params[5], params[1]); } catch (ModuleException &e) { ServerInstance->SNO->WriteToSnoMask('d',"Unable to ADDLINE type %s from %s: %s", params[0].c_str(), setter.c_str(), e.GetReason()); return true; } - xl->SetCreateTime(atoi(params[3].c_str())); + xl->SetCreateTime(created); if (ServerInstance->XLines->AddLine(xl, NULL)) { if (xl->duration) |