tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yo...@apache.org
Subject cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler JspReader.java
Date Fri, 19 Nov 2004 15:17:41 GMT
yoavs       2004/11/19 07:17:41

  Modified:    webapps/docs Tag: TOMCAT_5_0 changelog.xml
               jasper2/src/share/org/apache/jasper/compiler Tag: TOMCAT_5_0
                        JspReader.java
  Log:
  Bugzilla 29866: JspReader#skipUntil may try to read beyond the end of the file
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.70.2.79 +3 -0      jakarta-tomcat-catalina/webapps/docs/changelog.xml
  
  Index: changelog.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-catalina/webapps/docs/changelog.xml,v
  retrieving revision 1.70.2.78
  retrieving revision 1.70.2.79
  diff -u -r1.70.2.78 -r1.70.2.79
  --- changelog.xml	19 Nov 2004 15:01:34 -0000	1.70.2.78
  +++ changelog.xml	19 Nov 2004 15:17:40 -0000	1.70.2.79
  @@ -95,6 +95,9 @@
         <update> 
           Updated JspC usage messages to include recently added configurable parameters.
(yoavs) 
         </update> 
  +      <fix>
  +        <bug>29866</bug>: JspReader#skipUntil may try to read beyond the end
of the file. (yoavs)
  +      </fix>
       </changelog>
     </subsection>
   
  
  
  
  No                   revision
  No                   revision
  1.20.2.2  +9 -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.20.2.1
  retrieving revision 1.20.2.2
  diff -u -r1.20.2.1 -r1.20.2.2
  --- JspReader.java	10 Aug 2004 23:33:02 -0000	1.20.2.1
  +++ JspReader.java	19 Nov 2004 15:17:40 -0000	1.20.2.2
  @@ -160,7 +160,10 @@
   	return caw.toString();
       }
   
  -    int peekChar() {
  +    int peekChar() throws JasperException { 
  +        if (!hasMoreInput()) 
  +            return -1; 
  +
   	return current.stream[current.cursor];
       }
   
  @@ -352,7 +355,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 +372,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