Skip to content
This repository has been archived by the owner on Nov 9, 2020. It is now read-only.

Remove the dependency on POI's Workbook #36

Open
punkeel opened this issue Aug 1, 2018 · 4 comments
Open

Remove the dependency on POI's Workbook #36

punkeel opened this issue Aug 1, 2018 · 4 comments

Comments

@punkeel
Copy link
Contributor

punkeel commented Aug 1, 2018

Version: master
It may be possible to use exclusively NPOIFSFileSystem, and do the filtering by hand (removing most of the file sanity checks)

@punkeel
Copy link
Contributor Author

punkeel commented Aug 1, 2018

maldocs/66f9c88cf203e4c5eadf93189a9e81dde51d5a39a0784c2b2e28f1846d0ca519
INFO Found Macros, removing them.
INFO Found Compound Objects, removing them.
Exception in thread "main" org.apache.poi.util.RecordFormatException: Unhandled Continue Record followining class org.apache.poi.hssf.record.TabIdRecord
	at org.apache.poi.hssf.record.RecordFactoryInputStream.readNextRecord(RecordFactoryInputStream.java:361)
	at org.apache.poi.hssf.record.RecordFactoryInputStream.nextRecord(RecordFactoryInputStream.java:255)
	at org.apache.poi.hssf.record.RecordFactory.createRecords(RecordFactory.java:494)
	at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:356)
	at org.apache.poi.ss.usermodel.WorkbookFactory.create(WorkbookFactory.java:102)
	at org.apache.poi.ss.usermodel.WorkbookFactory.create(WorkbookFactory.java:64)
	at xyz.docbleach.module.ole2.ExcelRecordCleaner.cleanupAndSaveExcel97(ExcelRecordCleaner.java:28)
	at xyz.docbleach.module.ole2.OLE2Bleach.sanitize(OLE2Bleach.java:55)
	at xyz.docbleach.api.bleach.CompositeBleach.sanitize(CompositeBleach.java:74)
	at xyz.docbleach.api.BleachSession.sanitize(BleachSession.java:68)
	at xyz.docbleach.cli.Main.sanitize(Main.java:84)
	at xyz.docbleach.cli.Main.main(Main.java:57)

@punkeel
Copy link
Contributor Author

punkeel commented Aug 1, 2018

maldocs/4785027159a093fbf9542fb5c26fa5fbb31fbedb07193cc6b34fd38bbc7713d6
INFO Found Macros, removing them.
INFO Found Compound Objects, removing them.
Exception in thread "main" org.apache.poi.util.RecordFormatException: The content of an excel record cannot exceed 8224 bytes
	at org.apache.poi.hssf.record.RecordInputStream.nextRecord(RecordInputStream.java:222)
	at org.apache.poi.hssf.record.RecordFactoryInputStream$StreamEncryptionInfo.<init>(RecordFactoryInputStream.java:57)
	at org.apache.poi.hssf.record.RecordFactoryInputStream.<init>(RecordFactoryInputStream.java:187)
	at org.apache.poi.hssf.record.RecordFactory.createRecords(RecordFactory.java:491)
	at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:356)
	at org.apache.poi.ss.usermodel.WorkbookFactory.create(WorkbookFactory.java:102)
	at org.apache.poi.ss.usermodel.WorkbookFactory.create(WorkbookFactory.java:64)
	at xyz.docbleach.module.ole2.ExcelRecordCleaner.cleanupAndSaveExcel97(ExcelRecordCleaner.java:28)
	at xyz.docbleach.module.ole2.OLE2Bleach.sanitize(OLE2Bleach.java:55)
	at xyz.docbleach.api.bleach.CompositeBleach.sanitize(CompositeBleach.java:74)
	at xyz.docbleach.api.BleachSession.sanitize(BleachSession.java:68)
	at xyz.docbleach.cli.Main.sanitize(Main.java:84)
	at xyz.docbleach.cli.Main.main(Main.java:57)

@punkeel
Copy link
Contributor Author

punkeel commented Aug 1, 2018

maldocs/9272bc7b44b369d95c5007a2e327901ddf1f0051d79053af9c3bfd5d24acae03
INFO Found Macros, removing them.
INFO Found Compound Objects, removing them.
Exception in thread "main" org.apache.poi.util.RecordFormatException: Unable to construct record instance
	at org.apache.poi.hssf.record.RecordFactory$ReflectionConstructorRecordCreator.create(RecordFactory.java:98)
	at org.apache.poi.hssf.record.RecordFactory.createSingleRecord(RecordFactory.java:345)
	at org.apache.poi.hssf.record.RecordFactoryInputStream.readNextRecord(RecordFactoryInputStream.java:289)
	at org.apache.poi.hssf.record.RecordFactoryInputStream.nextRecord(RecordFactoryInputStream.java:255)
	at org.apache.poi.hssf.record.RecordFactory.createRecords(RecordFactory.java:494)
	at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:356)
	at org.apache.poi.ss.usermodel.WorkbookFactory.create(WorkbookFactory.java:102)
	at org.apache.poi.ss.usermodel.WorkbookFactory.create(WorkbookFactory.java:64)
	at xyz.docbleach.module.ole2.ExcelRecordCleaner.cleanupAndSaveExcel97(ExcelRecordCleaner.java:28)
	at xyz.docbleach.module.ole2.OLE2Bleach.sanitize(OLE2Bleach.java:55)
	at xyz.docbleach.api.bleach.CompositeBleach.sanitize(CompositeBleach.java:74)
	at xyz.docbleach.api.BleachSession.sanitize(BleachSession.java:68)
	at xyz.docbleach.cli.Main.sanitize(Main.java:84)
	at xyz.docbleach.cli.Main.main(Main.java:57)
Caused by: java.lang.RuntimeException: unexpected boolean encoding (4)
	at org.apache.poi.ss.formula.constant.ConstantValueParser.readBoolean(ConstantValueParser.java:88)
	at org.apache.poi.ss.formula.constant.ConstantValueParser.readAConstantValue(ConstantValueParser.java:68)
	at org.apache.poi.ss.formula.constant.ConstantValueParser.parse(ConstantValueParser.java:52)
	at org.apache.poi.hssf.record.CRNRecord.<init>(CRNRecord.java:50)
	at sun.reflect.GeneratedConstructorAccessor7.newInstance(Unknown Source)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
	at org.apache.poi.hssf.record.RecordFactory$ReflectionConstructorRecordCreator.create(RecordFactory.java:84)
	... 13 more

@punkeel
Copy link
Contributor Author

punkeel commented Aug 1, 2018

maldocs/43e4152fb9b0776410ea7849f75da023800e43b907f3fb9672cff37df0398a44
INFO Found Macros, removing them.
INFO Found Compound Objects, removing them.
Exception in thread "main" org.apache.poi.hssf.record.RecordInputStream$LeftoverDataException: Initialisation of record 0x22(DateWindow1904Record) left 42 bytes remaining still to be read.
	at org.apache.poi.hssf.record.RecordInputStream.hasNextRecord(RecordInputStream.java:178)
	at org.apache.poi.hssf.record.RecordFactoryInputStream.nextRecord(RecordFactoryInputStream.java:235)
	at org.apache.poi.hssf.record.RecordFactory.createRecords(RecordFactory.java:494)
	at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:356)
	at org.apache.poi.ss.usermodel.WorkbookFactory.create(WorkbookFactory.java:102)
	at org.apache.poi.ss.usermodel.WorkbookFactory.create(WorkbookFactory.java:64)
	at xyz.docbleach.module.ole2.ExcelRecordCleaner.cleanupAndSaveExcel97(ExcelRecordCleaner.java:28)
	at xyz.docbleach.module.ole2.OLE2Bleach.sanitize(OLE2Bleach.java:55)
	at xyz.docbleach.api.bleach.CompositeBleach.sanitize(CompositeBleach.java:74)
	at xyz.docbleach.api.BleachSession.sanitize(BleachSession.java:68)
	at xyz.docbleach.cli.Main.sanitize(Main.java:84)
	at xyz.docbleach.cli.Main.main(Main.java:57)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant