This is an automated email from the ASF dual-hosted git repository.
remm pushed a commit to branch 10.1.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/10.1.x by this push:
new 06fc1d62fc Throw explicit exception when getResource returns null
06fc1d62fc is described below
commit 06fc1d62fcc1c711bc5cd21718f48c531643dbcf
Author: remm <[email protected]>
AuthorDate: Wed Sep 4 16:39:33 2024 +0200
Throw explicit exception when getResource returns null
Found by Coverity.
---
java/org/apache/jasper/compiler/TagLibraryInfoImpl.java | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/java/org/apache/jasper/compiler/TagLibraryInfoImpl.java
b/java/org/apache/jasper/compiler/TagLibraryInfoImpl.java
index fa247aaade..e94c32e2ad 100644
--- a/java/org/apache/jasper/compiler/TagLibraryInfoImpl.java
+++ b/java/org/apache/jasper/compiler/TagLibraryInfoImpl.java
@@ -16,6 +16,7 @@
*/
package org.apache.jasper.compiler;
+import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.PrintWriter;
import java.io.StringWriter;
@@ -269,6 +270,9 @@ class TagLibraryInfoImpl extends TagLibraryInfo implements
TagConstants {
URL url = null;
try {
url = ctxt.getResource(uri);
+ if (url == null) {
+ throw new FileNotFoundException();
+ }
/*
* When the TLD cache is built for a TLD contained within a JAR
within a WAR, the jar form of the URL is
* used for any nested JAR.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]