Переглянути джерело

Fix two more places where wrong/invalid files can lead to file-handle leaks currently

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1737489 13f79535-47bb-0310-9956-ffa450edef68
tags/REL_3_15_BETA2
Dominik Stadler 8 роки тому
джерело
коміт
3635648936

+ 1
- 0
src/ooxml/java/org/apache/poi/openxml4j/opc/OPCPackage.java Переглянути файл

@@ -429,6 +429,7 @@ public abstract class OPCPackage implements RelationshipSource, Closeable {
if (this.contentTypeManager == null) {
logger.log(POILogger.WARN,
"Unable to call close() on a package that hasn't been fully opened yet");
revert();
return;
}


+ 5
- 2
src/ooxml/java/org/apache/poi/openxml4j/opc/internal/ZipHelper.java Переглянути файл

@@ -247,8 +247,11 @@ public final class ZipHelper {
// Peek at the first few bytes to sanity check
FileInputStream input = new FileInputStream(file);
verifyZipHeader(input);
input.close();
try {
verifyZipHeader(input);
} finally {
input.close();
}

// Open as a proper zip file
return new ZipSecureFile(file);

Завантаження…
Відмінити
Зберегти