]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
common: Passing null pointer option_name to operator << in md_config_t::parse_option() 15881/head
authorJos Collin <jcollin@redhat.com>
Fri, 23 Jun 2017 13:38:03 +0000 (19:08 +0530)
committerJos Collin <jcollin@redhat.com>
Mon, 26 Jun 2017 09:18:05 +0000 (14:48 +0530)
Fixes the Coverity Scan Report:
CID 1412776 (#1 of 1): Explicit null dereferenced (FORWARD_NULL)19. var_deref_model: Passing null pointer option_name to operator <<, which dereferences it.

Fixed the review comments too in this commit.

Signed-off-by: Jos Collin <jcollin@redhat.com>
src/common/config.cc

index 8c026f89a9ffdcdd789dc39a88953b15ed5233c2..5065f4a141dff69e8dc1242a881638f4fc0cf3a7 100644 (file)
@@ -603,6 +603,7 @@ int md_config_t::parse_option(std::vector<const char*>& args,
   }
 
   if (ret != 0 || !error_message.empty()) {
+    assert(option_name);
     if (oss) {
       *oss << "Parse error setting " << option_name << " to '"
            << val << "' using injectargs";