luehe       2002/10/23 12:26:37

  Modified:    jasper2/src/share/org/apache/jasper/compiler Validator.java
               jasper2/src/share/org/apache/jasper/resources
                        messages.properties
  Log:
  Fixed Bugtraq 4767492: NPE generated by JSP page translator if custom
  tag uses undefined attribute
  
  Revision  Changes    Path
  1.47      +6 -6      
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Validator.java
  
  Index: Validator.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Validator.java,v
  retrieving revision 1.46
  retrieving revision 1.47
  diff -u -r1.46 -r1.47
  --- Validator.java    21 Oct 2002 20:13:32 -0000      1.46
  +++ Validator.java    23 Oct 2002 19:26:36 -0000      1.47
  @@ -679,7 +679,7 @@
            Hashtable tagDataAttrs = new Hashtable(attrs.getLength());
            for (int i=0; i<attrs.getLength(); i++) {
                boolean found = false;
  -             for (int j=0; j<tldAttrs.length; j++) {
  +             for (int j=0; tldAttrs != null && j<tldAttrs.length; j++) {
                    if (attrs.getQName(i).equals(tldAttrs[j].getName())) {
                        if (tldAttrs[j].canBeRequestTime()) {
                               Class expectedType = String.class;
  @@ -748,7 +748,7 @@
                                                      true);
                    } else {
                        err.jspError(n, "jsp.error.bad_attribute",
  -                                  attrs.getQName(i));
  +                                  attrs.getQName(i), n.getShortName());
                    }
                }
            }
  @@ -776,7 +776,7 @@
                            = new Node.JspAttribute(na, true);
                    } else {
                        err.jspError(n, "jsp.error.bad_attribute",
  -                                  na.getName());
  +                                  na.getName(), n.getShortName());
                    }
                }
            }
  
  
  
  1.48      +2 -2      
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/resources/messages.properties
  
  Index: messages.properties
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/resources/messages.properties,v
  retrieving revision 1.47
  retrieving revision 1.48
  diff -u -r1.47 -r1.48
  --- messages.properties       17 Oct 2002 22:56:02 -0000      1.47
  +++ messages.properties       23 Oct 2002 19:26:37 -0000      1.48
  @@ -150,7 +150,7 @@
   jsp.message.compiling_with=Compiling with: {0}
   jsp.message.template_text=template text
   jsp.error.missing_attribute=According to the TLD attribute {0} is mandatory for tag 
{1}
  -jsp.error.bad_attribute=Attribute {0} invalid according to the specified TLD
  +jsp.error.bad_attribute=Attribute {0} invalid for tag {1} according to TLD
   jsp.error.tld_not_found=Could not locate TLD {0}
   jsp.error.webxml_not_found=Could not locate web.xml
   jsp.cmd_line.usage=Usage: jsptoservlet [-o <path/to/outputDirectory>] 
[-keepgenerated] \
  
  
  

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

Reply via email to