From: Jos Collin Date: Fri, 23 Jun 2017 13:38:03 +0000 (+0530) Subject: common: Passing null pointer option_name to operator << in md_config_t::parse_option() X-Git-Tag: v12.1.2~1^2~23^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=61cde7a0fa23a9d8bfed48e0882ff5e8e263dab5;p=ceph.git common: Passing null pointer option_name to operator << in md_config_t::parse_option() 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 --- diff --git a/src/common/config.cc b/src/common/config.cc index 8c026f89a9ffd..5065f4a141dff 100644 --- a/src/common/config.cc +++ b/src/common/config.cc @@ -603,6 +603,7 @@ int md_config_t::parse_option(std::vector& args, } if (ret != 0 || !error_message.empty()) { + assert(option_name); if (oss) { *oss << "Parse error setting " << option_name << " to '" << val << "' using injectargs";