Return-Path: Delivered-To: apmail-xml-cocoon-cvs-archive@xml.apache.org Received: (qmail 95422 invoked by uid 500); 31 May 2001 15:15:18 -0000 Mailing-List: contact cocoon-cvs-help@xml.apache.org; run by ezmlm Precedence: bulk Reply-To: cocoon-dev@xml.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list cocoon-cvs@xml.apache.org Received: (qmail 92287 invoked by uid 500); 31 May 2001 15:08:17 -0000 Delivered-To: apmail-xml-cocoon2-cvs@apache.org Date: 31 May 2001 15:07:03 -0000 Message-ID: <20010531150703.90926.qmail@apache.org> From: cziegeler@apache.org To: xml-cocoon2-cvs@apache.org Subject: cvs commit: xml-cocoon2/src/org/apache/cocoon/components/sax XMLByteStreamInterpreter.java cziegeler 01/05/31 08:07:02 Modified: src/org/apache/cocoon/components/sax XMLByteStreamInterpreter.java Log: Fix for AIOOBE - reported by Tim Klaasen Revision Changes Path 1.4 +7 -7 xml-cocoon2/src/org/apache/cocoon/components/sax/XMLByteStreamInterpreter.java Index: XMLByteStreamInterpreter.java =================================================================== RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/components/sax/XMLByteStreamInterpreter.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- XMLByteStreamInterpreter.java 2001/05/22 14:36:46 1.3 +++ XMLByteStreamInterpreter.java 2001/05/31 15:06:56 1.4 @@ -20,7 +20,7 @@ * * @author Stefano Mazzocchi * @author Carsten Ziegeler - * @version CVS $Revision: 1.3 $ $Date: 2001/05/22 14:36:46 $ + * @version CVS $Revision: 1.4 $ $Date: 2001/05/31 15:06:56 $ */ public final class XMLByteStreamInterpreter @@ -87,14 +87,14 @@ case CHARACTERS: char[] chars = this.readChars(); int len = chars.length; - while (chars[len-1]==0) len--; - contentHandler.characters(chars, 0, len); + while (len > 0 && chars[len-1]==0) len--; + if (len > 0) contentHandler.characters(chars, 0, len); break; case IGNORABLE_WHITESPACE: char[] spaces = this.readChars(); len = spaces.length; - while (spaces[len-1]==0) len--; - contentHandler.characters(spaces, 0, len); + while (len > 0 && spaces[len-1]==0) len--; + if (len > 0) contentHandler.characters(spaces, 0, len); break; case PROCESSING_INSTRUCTION: contentHandler.processingInstruction(this.readString(), this.readString()); @@ -103,8 +103,8 @@ chars = this.readChars(); if (this.lexicalHandler != null) { len = chars.length; - while (chars[len-1]==0) len--; - lexicalHandler.comment(chars, 0, len); + while (len > 0 && chars[len-1]==0) len--; + if (len > 0) lexicalHandler.comment(chars, 0, len); } break; default: ---------------------------------------------------------------------- In case of troubles, e-mail: webmaster@xml.apache.org To unsubscribe, e-mail: cocoon-cvs-unsubscribe@xml.apache.org For additional commands, e-mail: cocoon-cvs-help@xml.apache.org