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/08/04 01:55:33 UTC

[Bug 61381] New: PushbackInputStreams passed to ZipHelper may not hold 8 bytes

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

            Bug ID: 61381
           Summary: PushbackInputStreams passed to ZipHelper may not hold
                    8 bytes
           Product: POI
           Version: unspecified
          Hardware: PC
                OS: Mac OS X 10.1
            Status: NEW
          Severity: normal
          Priority: P2
         Component: OPC
          Assignee: dev@poi.apache.org
          Reporter: ket1999@gmail.com
  Target Milestone: ---

Created attachment 35200
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=35200&action=edit
Example

ZipHelper tries to be efficient when checking the header by reusing
PushbackInputStreams that are given as input, but these streams may not hold
the 8 bytes that are pushed back, and can cause an exception.

Testable example is attached.

Workaround: Wrap InputStreams in BufferedInputStream before passing them to
anything that uses ZipHelper.

Solutions:
- always create a new PushbackInputStream
- stop using PushbackInputStream and switch to mark/reset + BufferedInputStream

-- 
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 61381] PushbackInputStreams passed to ZipHelper may not hold 8 bytes

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

Kenzie Togami <ke...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ket1999@gmail.com

-- 
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 61381] PushbackInputStreams passed to ZipHelper may not hold 8 bytes

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

--- Comment #1 from Andreas Beeker <ki...@apache.org> ---
Thanks for pointing this out.

I'm currently replacing the PushbackInputStream calls (option 2) and refactor
the file magic checks in one spot.

-- 
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 61381] PushbackInputStreams passed to ZipHelper may not hold 8 bytes

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

Andreas Beeker <ki...@apache.org> changed:

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

--- Comment #2 from Andreas Beeker <ki...@apache.org> ---
patched via r1804854

-- 
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 61381] PushbackInputStreams passed to ZipHelper may not hold 8 bytes

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

Andreas Beeker <ki...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 OS|Mac OS X 10.1               |All
            Version|unspecified                 |3.17-dev
           Hardware|PC                          |All

-- 
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