tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 38476] New: - org.apache.catalina.startup.TldConfig doesn't handle missing tlds well
Date Wed, 01 Feb 2006 15:25:29 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=38476>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=38476

           Summary: org.apache.catalina.startup.TldConfig doesn't handle
                    missing tlds well
           Product: Tomcat 5
           Version: 5.5.14
          Platform: Other
        OS/Version: other
            Status: NEW
          Severity: minor
          Priority: P2
         Component: Catalina
        AssignedTo: tomcat-dev@jakarta.apache.org
        ReportedBy: fgiust@apache.org


Missing tlds are not handled properly in TldConfig.tldScanTld(). Instead of
throwing an exception for the missing resource, an empty InputStream is created
and so an exception is generated by the xml parser

there is a bad catch around line 536:

try {
    inputSource = new InputSource(
                context.getServletContext().getResourceAsStream(resourcePath));
     if (inputSource == null) {
                throw new IllegalArgumentException
                    (sm.getString("contextConfig.tldResourcePath",
                                  resourcePath));
     }
     tldScanStream(inputSource);

====
as you can see "if (inputSource == null)" can't never be executed because of the
previous new InputSource(...) line. Should be fixed with:

InputStream stream = context.getServletContext().getResourceAsStream(resourcePath);

  if (stream == null) {
    throw new IllegalArgumentException
      (sm.getString("contextConfig.tldResourcePath",
                    resourcePath));
  }

            inputSource = new InputSource(stream );

            tldScanStream(inputSource);

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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


Mime
View raw message