Bug 66425: Avoid exceptions found via poi-fuzz

Fix one expected exception-text which is different
on newer Java versions

Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=63143

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1913384 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Dominik Stadler 2023-10-27 10:08:04 +00:00
parent 5cc8b9958c
commit 56eb1ccff6
5 changed files with 8 additions and 2 deletions

View File

@ -69,6 +69,7 @@ public abstract class BaseTestPPTIterating {
EXCLUDED.put("clusterfuzz-testcase-minimized-POIHSLFFuzzer-5231088823566336.ppt", FileNotFoundException.class);
EXCLUDED.put("clusterfuzz-testcase-minimized-POIFuzzer-6411649193738240.ppt", FileNotFoundException.class);
EXCLUDED.put("clusterfuzz-testcase-minimized-POIHSLFFuzzer-4838893004128256.ppt", FileNotFoundException.class);
EXCLUDED.put("clusterfuzz-testcase-minimized-POIHSLFFuzzer-4624961081573376.ppt", FileNotFoundException.class);
}
public static Stream<Arguments> files() {

View File

@ -68,7 +68,8 @@ public class TestPPTXMLDump extends BaseTestPPTIterating {
pFile.getName().equals("clusterfuzz-testcase-minimized-POIFuzzer-5681320547975168.ppt") ||
pFile.getName().equals("clusterfuzz-testcase-minimized-POIHSLFFuzzer-5231088823566336.ppt") ||
pFile.getName().equals("clusterfuzz-testcase-minimized-POIFuzzer-6411649193738240.ppt") ||
pFile.getName().equals("clusterfuzz-testcase-minimized-POIHSLFFuzzer-4838893004128256.ppt")) {
pFile.getName().equals("clusterfuzz-testcase-minimized-POIHSLFFuzzer-4838893004128256.ppt") ||
pFile.getName().equals("clusterfuzz-testcase-minimized-POIHSLFFuzzer-4624961081573376.ppt")) {
throw new FileNotFoundException();
}
}

View File

@ -69,7 +69,11 @@ public class AgileEncryptionHeader extends EncryptionHeader {
throw new EncryptedDocumentException("Unsupported chaining mode - "+ keyData.getCipherChaining());
}
int hashSize = keyData.getHashSize();
Integer hashSizeObj = keyData.getHashSize();
if (hashSizeObj == null) {
throw new EncryptedDocumentException("Invalid hash size: " + hashSizeObj);
}
int hashSize = hashSizeObj;
HashAlgorithm ha = keyData.getHashAlgorithm();
setHashAlgorithm(ha);

Binary file not shown.