Avoid NPE with malformed EscherAggregate

This commit is contained in:
Dominik Stadler 2026-02-14 18:25:36 +01:00
parent 55c1608a2d
commit e96c9e17c0
6 changed files with 7 additions and 1 deletions

View File

@ -292,6 +292,9 @@ public final class EscherAggregate extends AbstractEscherHolderRecord {
// Write the matching OBJ record
Record obj = shapeToObj.get(shapes.get(i));
if (obj == null) {
throw new IllegalStateException("Cannot serialize EscherAggregate with missing shape-object");
}
pos += obj.serialize(pos, data);
isFirst = false;

View File

@ -49,6 +49,7 @@ class TestBiffViewer extends BaseTestIteratingXLS {
excludes.put("clusterfuzz-testcase-minimized-POIHSSFFuzzer-6483562584932352.xls", IndexOutOfBoundsException.class);
excludes.put("clusterfuzz-testcase-minimized-POIHSSFFuzzer-5816431116615680.xls", RecordFormatException.class);
excludes.put("clusterfuzz-testcase-minimized-POIHSSFFuzzer-4734163573080064.xls", IndexOutOfBoundsException.class);
excludes.put("cf9f845e73447b092477d0472402a5baea4b8c9f.xls", RecordFormatException.class);
return excludes;
}

View File

@ -52,6 +52,7 @@ class TestRecordLister extends BaseTestIteratingXLS {
excludes.put("clusterfuzz-testcase-minimized-POIHSSFFuzzer-6483562584932352.xls", RecordFormatException.class);
excludes.put("clusterfuzz-testcase-minimized-POIHSSFFuzzer-5816431116615680.xls", RecordFormatException.class);
excludes.put("clusterfuzz-testcase-minimized-POIHSSFFuzzer-4734163573080064.xls", IndexOutOfBoundsException.class);
excludes.put("cf9f845e73447b092477d0472402a5baea4b8c9f.xls", RecordFormatException.class);
return excludes;
}

View File

@ -138,7 +138,8 @@ class TestDrawingAggregate {
filter(file ->
!file.getName().equals("clusterfuzz-testcase-minimized-POIHSSFFuzzer-5285517825277952.xls") &&
!file.getName().equals("clusterfuzz-testcase-minimized-POIHSSFFuzzer-4977868385681408.xls") &&
!file.getName().equals("crash-e329fca9087fe21bca4a80c8bc472a661c98d860.xls")).
!file.getName().equals("crash-e329fca9087fe21bca4a80c8bc472a661c98d860.xls") &&
!file.getName().equals("cf9f845e73447b092477d0472402a5baea4b8c9f.xls")).
map(Arguments::of);
}

Binary file not shown.