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 f78dcdc  MIME: Fix line_is_real false positive.
f78dcdc is described below

commit f78dcdc78ff8d7f4cae7b588c743c2a11ce2176f
Author: Alan M. Carroll <[email protected]>
AuthorDate: Thu Feb 28 10:56:44 2019 -0600

    MIME: Fix line_is_real false positive.
---
 proxy/hdrs/MIME.cc | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/proxy/hdrs/MIME.cc b/proxy/hdrs/MIME.cc
index d130b20..8d22324 100644
--- a/proxy/hdrs/MIME.cc
+++ b/proxy/hdrs/MIME.cc
@@ -2442,14 +2442,14 @@ MIMEScanner::get(TextView &input, TextView &output, 
bool &output_shares_input, b
   }
 
   // adjust out arguments.
+  output_shares_input = true;
   if (PARSE_RESULT_CONT != zret) {
     if (!m_line.empty()) {
       output = m_line;
       m_line.resize(0); // depending resize(0) not deallocating internal 
string memory.
       output_shares_input = false;
     } else {
-      output              = parsed_text;
-      output_shares_input = true;
+      output = parsed_text;
     }
   }
 
@@ -2569,8 +2569,8 @@ mime_parser_parse(MIMEParser *parser, HdrHeap *heap, 
MIMEHdrImpl *mh, const char
     //////////////////////////////////////////////////////////////////////
 
     if (must_copy_strings || (!line_is_real)) {
-      char *dup      = heap->duplicate_str(parsed.data(), parsed.size());
-      intptr_t delta = dup - parsed.data();
+      char *dup       = heap->duplicate_str(parsed.data(), parsed.size());
+      ptrdiff_t delta = dup - parsed.data();
       field_name.assign(field_name.data() + delta, field_name.size());
       field_value.assign(field_value.data() + delta, field_value.size());
     }

Reply via email to