From a8878569083bfa4753e9e118adee0ed1da6a0325 Mon Sep 17 00:00:00 2001 From: danieldg Date: Sun, 18 Oct 2009 03:09:39 +0000 Subject: Fix null dereference caused by tracking dummy git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11902 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_check.cpp | 6 +++--- src/modules/m_httpd_stats.cpp | 10 ++++++---- 2 files changed, 9 insertions(+), 7 deletions(-) (limited to 'src/modules') diff --git a/src/modules/m_check.cpp b/src/modules/m_check.cpp index 729667fa8..df42d4608 100644 --- a/src/modules/m_check.cpp +++ b/src/modules/m_check.cpp @@ -40,10 +40,10 @@ class CommandCheck : public Command { ExtensionItem* item = i->first; std::string value = item->serialize(FORMAT_USER, ext, i->second); - if (value.empty()) - dumpkeys << " " << i->first; - else + if (!value.empty()) ServerInstance->DumpText(user, checkstr + " meta:" + item->key + " " + value); + else if (!item->key.empty()) + dumpkeys << " " << item->key; } if (!dumpkeys.str().empty()) ServerInstance->DumpText(user,checkstr + " metadata", dumpkeys); diff --git a/src/modules/m_httpd_stats.cpp b/src/modules/m_httpd_stats.cpp index a451f6af9..5288130ce 100644 --- a/src/modules/m_httpd_stats.cpp +++ b/src/modules/m_httpd_stats.cpp @@ -73,10 +73,10 @@ class ModuleHttpStats : public Module { ExtensionItem* item = i->first; std::string value = item->serialize(FORMAT_USER, ext, i->second); - if (value.empty()) - data << "key << "\"/>"; - else + if (!value.empty()) data << "key << "\">" << Sanitize(value) << ""; + else if (!item->key.empty()) + data << "key << "\"/>"; } data << ""; } @@ -144,7 +144,9 @@ class ModuleHttpStats : public Module Membership* memb = x->second; data << "" << memb->user->uuid << "" << Sanitize(c->GetAllPrefixChars(x->first)) << "" - << memb->modes << ""; + << memb->modes << ""; + DumpMeta(data, memb); + data << ""; } DumpMeta(data, c); -- cgit v1.2.3