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