mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-18 18:14:38 +02:00
8266291: (jrtfs) Calling Files.exists may break the JRT filesystem
Reviewed-by: redestad, alanb
This commit is contained in:
parent
ebcf3991b7
commit
af4cd04c2e
2 changed files with 35 additions and 4 deletions
|
@ -468,6 +468,19 @@ public final class ImageReader implements AutoCloseable {
|
|||
|
||||
Node handleResource(String name) {
|
||||
Node n = null;
|
||||
if (!name.startsWith("/modules/")) {
|
||||
return null;
|
||||
}
|
||||
// Make sure that the thing that follows "/modules/" is a module name.
|
||||
int moduleEndIndex = name.indexOf('/', "/modules/".length());
|
||||
if (moduleEndIndex == -1) {
|
||||
return null;
|
||||
}
|
||||
ImageLocation moduleLoc = findLocation(name.substring(0, moduleEndIndex));
|
||||
if (moduleLoc == null || moduleLoc.getModuleOffset() == 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
String locationPath = name.substring("/modules".length());
|
||||
ImageLocation resourceLoc = findLocation(locationPath);
|
||||
if (resourceLoc != null) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue