d3c23e
--- java/org/apache/tomcat/util/buf/Utf8Decoder.java.orig	2018-10-01 11:41:20.080777790 -0400
d3c23e
+++ java/org/apache/tomcat/util/buf/Utf8Decoder.java	2018-10-01 11:42:07.421663409 -0400
d3c23e
@@ -277,6 +277,11 @@ public class Utf8Decoder extends Charset
d3c23e
                 outRemaining--;
d3c23e
             } else {
d3c23e
                 if (outRemaining < 2) {
d3c23e
+                    // Encoded with 4 bytes. inIndex currently points
d3c23e
+                    // to the final byte. Move it back to first byte.
d3c23e
+                    inIndex -= 3;
d3c23e
+                    in.position(inIndex - in.arrayOffset());
d3c23e
+                    out.position(outIndex - out.arrayOffset());
d3c23e
                     return CoderResult.OVERFLOW;
d3c23e
                 }
d3c23e
                 cArr[outIndex++] = (char) ((jchar >> 0xA) + 0xD7C0);
d3c23e
--- webapps/docs/changelog.xml.orig	2018-10-01 11:47:17.700912507 -0400
d3c23e
+++ webapps/docs/changelog.xml	2018-10-01 11:47:40.889856277 -0400
d3c23e
@@ -57,6 +57,16 @@
d3c23e
   They eventually become mixed with the numbered issues. (I.e., numbered
d3c23e
   issues do not "pop up" wrt. others).
d3c23e
 -->
d3c23e
+<section name="Tomcat 7.0.76-8 (csutherl)">
d3c23e
+  <subsection name="Catalina">
d3c23e
+    <changelog>
d3c23e
+      <fix>
d3c23e
+        Improve handing of overflow in the UTF-8 decoder with supplementary
d3c23e
+        characters. (markt)
d3c23e
+      </fix>
d3c23e
+    </changelog>
d3c23e
+  </subsection>
d3c23e
+</section>
d3c23e
 <section name="Tomcat 7.0.76-3 (csutherl)">
d3c23e
   <subsection name="Catalina">
d3c23e
     <changelog>