From: markt Date: Fri, 11 Apr 2008 21:02:41 +0000 (+0000) Subject: Fix for garbage test in bug 44494. Patch provided by Suzuki Yuichiro. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=8df95d484f4adf286e22adbad7fcbdc8a9913b1d;p=tomcat7.0 Fix for garbage test in bug 44494. Patch provided by Suzuki Yuichiro. git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@647307 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/java/org/apache/tomcat/util/buf/B2CConverter.java b/java/org/apache/tomcat/util/buf/B2CConverter.java index 7a1209879..995476b3e 100644 --- a/java/org/apache/tomcat/util/buf/B2CConverter.java +++ b/java/org/apache/tomcat/util/buf/B2CConverter.java @@ -213,6 +213,14 @@ final class ReadConvertor extends InputStreamReader { /** Reset the buffer */ public final void recycle() { + try { + // Must clear super's buffer. + while (ready()) { + // InputStreamReader#skip(long) will allocate buffer to skip. + read(); + } + } catch(IOException ioe){ + } } }