Prevent ClassCastException
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=63736
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@
1915003 13f79535-47bb-0310-9956-
ffa450edef68
@Override
public void initialize(EncryptionInfo info, LittleEndianInput dis) throws IOException {
+ if (!(dis instanceof InputStream)) {
+ throw new IllegalArgumentException("Had unexpected type of input: " + (dis == null ? "<null>" : dis.getClass()));
+ }
+
EncryptionDocument ed = parseDescriptor((InputStream)dis);
info.setHeader(new AgileEncryptionHeader(ed));
info.setVerifier(new AgileEncryptionVerifier(ed));
// fuzzed binaries
excludes.put("clusterfuzz-testcase-minimized-POIHSSFFuzzer-6322470200934400.xls", RuntimeException.class);
excludes.put("clusterfuzz-testcase-minimized-POIHSSFFuzzer-4819588401201152.xls", RuntimeException.class);
+ excludes.put("clusterfuzz-testcase-minimized-POIHSSFFuzzer-6537773940867072.xls", RuntimeException.class);
return excludes;
}