diff options
author | geniusdex geniusdex@31f1291d-b8d6-0310-a050-a5561fc1590b <geniusdex geniusdex@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864> | 2008-05-20 09:07:39 +0000 |
---|---|---|
committer | geniusdex geniusdex@31f1291d-b8d6-0310-a050-a5561fc1590b <geniusdex geniusdex@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864> | 2008-05-20 09:07:39 +0000 |
commit | 15bb6a806764b2ad46a5c9895d0e8b483c253c52 (patch) | |
tree | 97751a65c961e4f6b52c3e87727afe47154100c6 | |
parent | efb66237428593dadb71fd7288341c0409dcd9eb (diff) |
Applied patch by Hal to fix crashbug in his latest patch
git-svn-id: svn://svn.anope.org/anope/trunk@1396 31f1291d-b8d6-0310-a050-a5561fc1590b
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@1111 5417fbe8-f217-4b02-8779-1006273d7864
-rw-r--r-- | Changes | 1 | ||||
-rw-r--r-- | src/protocol/inspircd11.c | 16 |
2 files changed, 11 insertions, 6 deletions
@@ -61,6 +61,7 @@ Provided by Jan Milants <jan_renee@msn.com> - 2008 Provided by Hal9000 <hal9000@pimpmylinux.org> - 2005 04/29 F Potential crash in channels.c. [ #00] 04/29 F TS handling on incoming FMODE with InspIRCd 1.1. [ #00] +05/20 F Possible crash in new TS handling for InspIRCd 1.1. [ #00] Anope Version 1.7.21 -------------------- diff --git a/src/protocol/inspircd11.c b/src/protocol/inspircd11.c index bf96d8b21..c8315d231 100644 --- a/src/protocol/inspircd11.c +++ b/src/protocol/inspircd11.c @@ -674,12 +674,16 @@ int anope_event_fmode(char *source, int ac, char **av) return MOD_CONT; /* Checking the TS for validity to avoid desyncs */ - c = findchan(av[0]); - if (c->creation_time > strtol(av[1], NULL, 10)) { - /* Our TS is bigger, we should lower it */ - c->creation_time = strtol(av[1], NULL, 10); - } else if (c->creation_time < strtol(av[1], NULL, 10)) { - /* The TS we got is bigger, we should ignore the message. */ + if ((c = findchan(av[0]))) { + if (c->creation_time > strtol(av[1], NULL, 10)) { + /* Our TS is bigger, we should lower it */ + c->creation_time = strtol(av[1], NULL, 10); + } else if (c->creation_time < strtol(av[1], NULL, 10)) { + /* The TS we got is bigger, we should ignore this message. */ + return MOD_CONT; + } + } else { + /* Got FMODE for a non-existing channel */ return MOD_CONT; } |