Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ce78b9e1 authored by Andreas Gampe's avatar Andreas Gampe
Browse files

Frameworks/base: Fix FastPrintWriter infinite loop

Check for error condition in loop.

Bug: 29123428
Change-Id: I361ed27ecb8f05512d7e17f8045f3d34667d32d8
parent 79cb94b8
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -345,7 +345,7 @@ public class FastPrintWriter extends PrintWriter {
            if (mOutputStream != null) {
                CharBuffer charBuffer = CharBuffer.wrap(mText, 0, mPos);
                CoderResult result = mCharset.encode(charBuffer, mBytes, true);
                while (true) {
                while (!mIoError) {
                    if (result.isError()) {
                        throw new IOException(result.toString());
                    } else if (result.isOverflow()) {