tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kin...@apache.org
Subject cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler JspReader.java
Date Tue, 27 Jul 2004 21:59:39 GMT
kinman      2004/07/27 14:59:39

  Modified:    jasper2/src/share/org/apache/jasper/compiler JspReader.java
  Log:
  - Fix 29866: ArrayIndexOutOfBoundsException in JspReader.
  
    Thanks Stefan Bodewig for the patch.
  
  Revision  Changes    Path
  1.23      +8 -2      jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/JspReader.java
  
  Index: JspReader.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/JspReader.java,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- JspReader.java	27 Jul 2004 21:57:02 -0000	1.22
  +++ JspReader.java	27 Jul 2004 21:59:39 -0000	1.23
  @@ -160,7 +160,9 @@
           return caw.toString();
       }
   
  -    int peekChar() {
  +    int peekChar() throws JasperException {
  +        if (!hasMoreInput())
  +            return -1;
           return current.stream[current.cursor];
       }
   
  @@ -352,7 +354,7 @@
           return ret;
       }
   
  -    final boolean isSpace() {
  +    final boolean isSpace() throws JasperException {
           // Note: If this logic changes, also update Node.TemplateText.rtrim()
           return peekChar() <= ' ';
       }
  @@ -369,6 +371,10 @@
           skipSpaces();
           stringBuffer.setLength(0);
           
  +        if (!hasMoreInput()) {
  +            return "";
  +        }
  +
           int ch = peekChar();
           
           if (quoted) {
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Mime
View raw message