You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by bu...@apache.org on 2017/07/13 02:26:16 UTC

[Bug 61286] New: can not deal with WriteProtectRecord element

https://bz.apache.org/bugzilla/show_bug.cgi?id=61286

            Bug ID: 61286
           Summary: can not deal with WriteProtectRecord element
           Product: POI
           Version: 3.16-FINAL
          Hardware: PC
                OS: Mac OS X 10.1
            Status: NEW
          Severity: critical
          Priority: P2
         Component: HSSF
          Assignee: dev@poi.apache.org
          Reporter: lejingw@163.com
  Target Milestone: ---

Created attachment 35124
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=35124&action=edit
the excel to be read

HSSF can not deal with WriteProtectRecord element which is created by MS Excel
97(in the attachment).


the constructor method `WriteProtectRecord(RecordInputStream in)` of class
`org.apache.poi.hssf.record.WriteProtectRecord` will not consume the right
amount of byte in `org.apache.poi.hssf.record.RecordInputStream#_dataInput`,
the amount to be consumed should be equals to
`org.apache.poi.hssf.record.RecordInputStream#_currentDataLength`


The exception stack is as follows:

org.apache.poi.hssf.record.RecordInputStream$LeftoverDataException:
Initialisation of record 0x86(WriteProtectRecord) left 2 bytes remaining still
to be read.
        at
org.apache.poi.hssf.record.RecordInputStream.hasNextRecord(RecordInputStream.java:177)
        at
org.apache.poi.hssf.record.RecordFactoryInputStream.nextRecord(RecordFactoryInputStream.java:234)
        at
org.apache.poi.hssf.record.RecordFactory.createRecords(RecordFactory.java:494)
        at
org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:348)
        at
org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:405)
        at
org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:386)
        at poi.HSSFReadWrite.readFile(HSSFReadWrite.java:53)
        at poi.HSSFReadWrite.common(HSSFReadWrite.java:170)
        at poi.HSSFReadWrite.testRead1(HSSFReadWrite.java:293)

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 61286] can not deal with WriteProtectRecord element

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=61286

lejingw <le...@163.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #35124|0                           |1
        is obsolete|                            |

--- Comment #2 from lejingw <le...@163.com> ---
Created attachment 35134
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=35134&action=edit
the excel to be read with exception

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 61286] can not deal with WriteProtectRecord element

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=61286

--- Comment #3 from lejingw <le...@163.com> ---
Created attachment 35135
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=35135&action=edit
consume the remaining bytes

the exception also exist in 3.17-beta1

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 61286] can not deal with WriteProtectRecord element

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=61286

Tim Allison <ta...@mitre.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|NEW                         |RESOLVED

--- Comment #4 from Tim Allison <ta...@mitre.org> ---
Thank you!

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 61286] can not deal with WriteProtectRecord element

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=61286

--- Comment #1 from Tim Allison <ta...@mitre.org> ---
This file is identical to the file you shared on 61287.  Would it be possible
to re-attach either here or on 61287.  Thank you!

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org