You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2006/02/01 16:25:29 UTC
DO NOT REPLY [Bug 38476] New: - org.apache.catalina.startup.TldConfig doesn't handle missing tlds well
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
DO NOT REPLY [Bug 38476] - org.apache.catalina.startup.TldConfig doesn't handle missing tlds well
Posted by bu...@apache.org.
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
yoavs@computer.org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
------- Additional Comments From yoavs@computer.org 2006-04-13 20:42 -------
Good suggestion. I've applied a slightly modified version of the patch which
does what you suggest but also checks for a null input source afterwards as the
current behavior does, just in case there's a regression possibility I'm not
aware of. Better safe than sorry ;) Thanks for contributing this.
--
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