From 530fcdcc98ca3f5d4e0243afadb515fe21955dcd Mon Sep 17 00:00:00 2001 From: Jackmcbarn Date: Wed, 1 Dec 2010 15:25:35 -0500 Subject: Explain why a null pointer is safe here --- src/commands/cmd_rules.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/commands/cmd_rules.cpp') diff --git a/src/commands/cmd_rules.cpp b/src/commands/cmd_rules.cpp index 3958a1d0e..21d5a3293 100644 --- a/src/commands/cmd_rules.cpp +++ b/src/commands/cmd_rules.cpp @@ -47,7 +47,11 @@ CmdResult CommandRules::Handle (const std::vector& parameters, User ConfigTag* tag = NULL; if (IS_LOCAL(user)) tag = IS_LOCAL(user)->MyClass->config; + + // Although tag could be null here, ConfigTag::getString can be called on a null object safely. + // cppcheck-suppress nullPointer std::string rules_name = tag->getString("rules", "rules"); + ConfigFileCache::iterator rules = ServerInstance->Config->Files.find(rules_name); if (rules == ServerInstance->Config->Files.end()) { -- cgit v1.3.1-10-gc9f91