diff options
author | rburchell <rburchell@5417fbe8-f217-4b02-8779-1006273d7864> | 2009-01-24 14:03:46 +0000 |
---|---|---|
committer | rburchell <rburchell@5417fbe8-f217-4b02-8779-1006273d7864> | 2009-01-24 14:03:46 +0000 |
commit | 7379abc04a5b8aa157db7416be0d5f2657d1b6da (patch) | |
tree | 60232c5f0414368d893956b4c5fe0c2044581fbc /src | |
parent | 619c513beee687633b46049dce91ef9f2676aa8e (diff) |
Trap empty idents from older Anope mysql UseRDB imports, and don't allow them to be set.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@1933 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src')
-rw-r--r-- | src/hostserv.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/hostserv.c b/src/hostserv.c index e321316b7..60cbec841 100644 --- a/src/hostserv.c +++ b/src/hostserv.c @@ -403,12 +403,23 @@ void load_hs_dbase(dbFILE * f) SAFE(read_string(&vHost, f)); SAFE(read_string(&creator, f)); SAFE(read_int32(&time, f)); + + // Older Anope could save an empty vident when importing from MySQL, so trap that here. + if (!strcmp(vIdent, "")) + { + delete [] vIdent; + vIdent = NULL; + } + addHostCore(nick, vIdent, vHost, creator, time); /* could get a speed increase by not searching the list */ delete [] nick; /* as we know the db is in alphabetical order... */ delete [] vHost; delete [] creator; - delete [] vIdent; - } else { + if (vIdent) + delete [] vIdent; + } + else + { fatal("Invalid format in %s %d", HostDBName, c); } } |