From 7379abc04a5b8aa157db7416be0d5f2657d1b6da Mon Sep 17 00:00:00 2001 From: rburchell Date: Sat, 24 Jan 2009 14:03:46 +0000 Subject: [PATCH] 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 --- src/hostserv.c | 15 +++++++++++++-- 1 file 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); } }