From 2f0c3281d7deba949147af642fef48b8779020ac Mon Sep 17 00:00:00 2001 From: Adam Date: Sat, 9 Nov 2013 06:43:49 -0500 Subject: Fix parsing ADDLINE with expiration or creation dates past ~2038 probably --- src/modules/m_spanningtree/addline.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src') 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) -- cgit v1.2.3