This is an automated email from the ASF dual-hosted git repository.
remm pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/9.0.x by this push:
new 0ec7fbcac7 Throw explicit exception when getResource returns null
0ec7fbcac7 is described below
commit 0ec7fbcac796278fa23e4a610495987067e7d0e3
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 6fca6ee126..b3a69acc36 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]