You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by am...@apache.org on 2019/06/07 12:51:41 UTC

[trafficserver] branch master updated: Fix crash in MIMEScanner::append with std::string. See #5587.

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

amc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
     new b7b6b4b  Fix crash in MIMEScanner::append with std::string. See #5587.
b7b6b4b is described below

commit b7b6b4bc9a649822376ddeaeaaaf251baa4d0e2d
Author: Alan M. Carroll <am...@apache.org>
AuthorDate: Thu Jun 6 18:22:00 2019 -0500

    Fix crash in MIMEScanner::append with std::string. See #5587.
---
 proxy/http2/Http2Stream.cc | 1 +
 proxy/http2/Http2Stream.h  | 3 +--
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/proxy/http2/Http2Stream.cc b/proxy/http2/Http2Stream.cc
index 75bf402..436f585 100644
--- a/proxy/http2/Http2Stream.cc
+++ b/proxy/http2/Http2Stream.cc
@@ -755,6 +755,7 @@ Http2Stream::destroy()
   chunked_handler.clear();
   clear_timers();
   clear_io_events();
+  http_parser_clear(&http_parser);
 
   super::destroy();
   THREAD_FREE(this, http2StreamAllocator, this_ethread());
diff --git a/proxy/http2/Http2Stream.h b/proxy/http2/Http2Stream.h
index 895f8e1..1e159da 100644
--- a/proxy/http2/Http2Stream.h
+++ b/proxy/http2/Http2Stream.h
@@ -41,8 +41,6 @@ public:
   typedef ProxyTransaction super; ///< Parent type.
   Http2Stream(Http2StreamId sid = 0, ssize_t initial_rwnd = Http2::initial_window_size) : client_rwnd(initial_rwnd), _id(sid)
   {
-    http_parser_init(&http_parser);
-
     SET_HANDLER(&Http2Stream::main_event_handler);
   }
 
@@ -57,6 +55,7 @@ public:
     // FIXME: Are you sure? every "stream" needs request_header?
     _req_header.create(HTTP_TYPE_REQUEST);
     response_header.create(HTTP_TYPE_RESPONSE);
+    http_parser_init(&http_parser);
   }
 
   int main_event_handler(int event, void *edata);