This is an automated email from the ASF dual-hosted git repository.

phrocker pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nifi-minifi-cpp.git


The following commit(s) were added to refs/heads/master by this push:
     new a8cd7c9  MINIFICPP-705: Previous fix for some travis failures. Will 
help isolate any others
a8cd7c9 is described below

commit a8cd7c9a27f4fe88423a04ced1c141fecd95c640
Author: Marc Parisi <[email protected]>
AuthorDate: Mon Jan 7 07:18:49 2019 -0500

    MINIFICPP-705: Previous fix for some travis failures. Will help isolate any 
others
    
    This closes #469.
    
    Signed off by GH user arpadboda.
    
    Signed-off-by: Marc Parisi <[email protected]>
---
 extensions/civetweb/processors/ListenHTTP.cpp | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/extensions/civetweb/processors/ListenHTTP.cpp 
b/extensions/civetweb/processors/ListenHTTP.cpp
index 6f00776..dbb00a4 100644
--- a/extensions/civetweb/processors/ListenHTTP.cpp
+++ b/extensions/civetweb/processors/ListenHTTP.cpp
@@ -264,6 +264,10 @@ void ListenHTTP::Handler::set_header_attributes(const 
mg_request_info *req_info,
 
 bool ListenHTTP::Handler::handlePost(CivetServer *server, struct mg_connection 
*conn) {
   auto req_info = mg_get_request_info(conn);
+  if (!req_info) {
+      logger_->log_error("ListenHTTP handling POST resulted in a null 
request");
+      return false;
+  }
   logger_->log_debug("ListenHTTP handling POST request of length %ll", 
req_info->content_length);
 
   if (!auth_request(conn, req_info)) {
@@ -323,6 +327,10 @@ bool ListenHTTP::Handler::auth_request(mg_connection 
*conn, const mg_request_inf
 
 bool ListenHTTP::Handler::handleGet(CivetServer *server, struct mg_connection 
*conn) {
   auto req_info = mg_get_request_info(conn);
+  if (!req_info) {
+      logger_->log_error("ListenHTTP handling GET resulted in a null request");
+      return false;
+  }
   logger_->log_debug("ListenHTTP handling GET request of URI %s", 
req_info->request_uri);
 
   if (!auth_request(conn, req_info)) {

Reply via email to