From: Marcin Siodelski Date: Tue, 14 May 2019 07:41:13 +0000 (+0200) Subject: [#599,!320] Protect against null ptr dereferencing in HTTP log messages. X-Git-Tag: Kea-1.6.0-beta~161 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=385bf32b43be1cb7feae669164edc542c9e1472e;p=thirdparty%2Fkea.git [#599,!320] Protect against null ptr dereferencing in HTTP log messages. As a result of review. --- diff --git a/src/lib/http/client.cc b/src/lib/http/client.cc index 91359e47f9..971e493e11 100644 --- a/src/lib/http/client.cc +++ b/src/lib/http/client.cc @@ -587,7 +587,8 @@ Connection::terminate(const boost::system::error_code& ec, LOG_DEBUG(http_logger, isc::log::DBGLVL_TRACE_BASIC_DATA, HTTP_SERVER_RESPONSE_RECEIVED_DETAILS) .arg(url_.toText()) - .arg(parser_->getBufferAsString(MAX_LOGGED_MESSAGE_SIZE)); + .arg((parser_ ? parser_->getBufferAsString(MAX_LOGGED_MESSAGE_SIZE) + : "[HttpResponseParser is null]")); } else { std::string err = parsing_error.empty() ? ec.message() : parsing_error; @@ -603,7 +604,8 @@ Connection::terminate(const boost::system::error_code& ec, LOG_DEBUG(http_logger, isc::log::DBGLVL_TRACE_BASIC_DATA, HTTP_BAD_SERVER_RESPONSE_RECEIVED_DETAILS) .arg(url_.toText()) - .arg(parser_->getBufferAsString()); + .arg((parser_ ? parser_->getBufferAsString() + : "[HttpResponseParser is null]")); } }