summaryrefslogtreecommitdiff
path: root/src/modules/m_spanningtree
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2013-11-09 06:43:49 -0500
committerAdam <Adam@anope.org>2013-11-09 06:43:49 -0500
commit2f0c3281d7deba949147af642fef48b8779020ac (patch)
treeb5c92e1f37a5f6dac6dea7abeb16e03428cb5729 /src/modules/m_spanningtree
parent9cdf47629faeec64edc77ff0729dc55946ed753c (diff)
Fix parsing ADDLINE with expiration or creation dates past ~2038 probably
Diffstat (limited to 'src/modules/m_spanningtree')
-rw-r--r--src/modules/m_spanningtree/addline.cpp8
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 &params)
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)