We try to avoid throwing ConcurrentModificationException,
but it was possible to trigger one here with a specially
crafted input-file
Should fix https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=62861
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@
1912797 13f79535-47bb-0310-9956-
ffa450edef68
return;
}
rv.visitRecord(_begin);
- for (RecordBase rb : _recs) {
+
+ // need to copy list to avoid ConcurrentModificationException
+ // as there are cases where the visitor modifies the list itself
+ for (RecordBase rb : new ArrayList<>(_recs)) {
if (rb instanceof RecordAggregate) {
((RecordAggregate) rb).visitContainedRecords(rv);
} else {
excludes.put("protected_66115.xls", EncryptedDocumentException.class);
excludes.put("clusterfuzz-testcase-minimized-POIHSSFFuzzer-5285517825277952.xls", IllegalArgumentException.class);
excludes.put("clusterfuzz-testcase-minimized-POIHSSFFuzzer-5436547081830400.xls", IllegalArgumentException.class);
+ excludes.put("clusterfuzz-testcase-minimized-POIHSSFFuzzer-5889658057523200.xls", IndexOutOfBoundsException.class);
return excludes;
}
excludes.put("poi-fuzz.xls", RecordFormatException.class);
excludes.put("protected_66115.xls", RecordFormatException.class);
excludes.put("clusterfuzz-testcase-minimized-POIHSSFFuzzer-5786329142919168.xls", IllegalStateException.class);
+ excludes.put("clusterfuzz-testcase-minimized-POIHSSFFuzzer-5889658057523200.xls", IndexOutOfBoundsException.class);
return excludes;
}
protected Map<String, Class<? extends Throwable>> getExcludes() {
Map<String, Class<? extends Throwable>> excludes = super.getExcludes();
excludes.put("clusterfuzz-testcase-minimized-POIHSSFFuzzer-5786329142919168.xls", RecordFormatException.class);
+ excludes.put("clusterfuzz-testcase-minimized-POIHSSFFuzzer-5889658057523200.xls", IndexOutOfBoundsException.class);
return excludes;
}