diff options
author | Dominik Stadler <centic@apache.org> | 2015-08-19 10:57:19 +0000 |
---|---|---|
committer | Dominik Stadler <centic@apache.org> | 2015-08-19 10:57:19 +0000 |
commit | 255ace6918dbdf7195e4e2a0db08284ed0131993 (patch) | |
tree | 72059a9007bae4d3ad72f3eea2982c44a518ec70 /src/ooxml/testcases/org/apache/poi/openxml4j | |
parent | 14be991668e4ae8f05b349ae3b01c40627ce2e21 (diff) | |
download | poi-255ace6918dbdf7195e4e2a0db08284ed0131993.tar.gz poi-255ace6918dbdf7195e4e2a0db08284ed0131993.zip |
* Adjust reported text when a Zip-Bomb is detected to allow to quickly see why it happened
* Fail only with inflation ratio lower than the min, not equals, to behave as documented
* Add getters to be able to temporarily adjust the limits for unit tests
* Allow lower inflation ratio in OOXMLPrettyPrint as this is a dev-only tool
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1696556 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/ooxml/testcases/org/apache/poi/openxml4j')
-rw-r--r-- | src/ooxml/testcases/org/apache/poi/openxml4j/opc/TestPackage.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/ooxml/testcases/org/apache/poi/openxml4j/opc/TestPackage.java b/src/ooxml/testcases/org/apache/poi/openxml4j/opc/TestPackage.java index a6955958fb..6e3b89f53e 100644 --- a/src/ooxml/testcases/org/apache/poi/openxml4j/opc/TestPackage.java +++ b/src/ooxml/testcases/org/apache/poi/openxml4j/opc/TestPackage.java @@ -748,12 +748,12 @@ public final class TestPackage { if(e instanceof InvocationTargetException) { InvocationTargetException t = (InvocationTargetException)e; IOException t2 = (IOException)t.getTargetException(); - if("Zip bomb detected! Exiting.".equals(t2.getMessage())) { + if(t2.getMessage().startsWith("Zip bomb detected!")) { return; } } - if ("Zip bomb detected! Exiting.".equals(e.getMessage())) { + if(e.getMessage().startsWith("Zip bomb detected!")) { return; } @@ -766,3 +766,4 @@ public final class TestPackage { throw new IllegalStateException("Expected to catch an Exception because of a detected Zip Bomb, but did not find the related error message in the exception", e); } } + |