OSDN Git Service

AI 148694: Manually copied from cupcake_dcm CL 148669-p9. When resetting the
authorAndy Stadler <nobody@android.com>
Mon, 11 May 2009 21:03:58 +0000 (14:03 -0700)
committerThe Android Open Source Project <initial-contribution@android.com>
Mon, 11 May 2009 21:03:58 +0000 (14:03 -0700)
  mode of the encoder, clear the leftover input & output buffers.
  This claims to fix buffer overwriting we're seeing during account
  sync and message download.
  BUG=1822859

Automated import of CL 148694

libcore/icu/src/main/java/com/ibm/icu4jni/charset/CharsetEncoderICU.java

index 0fdb2c5..51d67ac 100644 (file)
@@ -197,6 +197,10 @@ public final class CharsetEncoderICU extends CharsetEncoder {
         data[INVALID_CHARS] = 0;
         data[INPUT_HELD] = 0;
         savedInputHeldLen = 0;
+        // BEGIN android-added
+        output = null;
+        input = null;
+        // END android-added
     }
 
     /**