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

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

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

Bugzilla from bugzilla@apache.org
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: [hidden email]
          Reporter: [hidden email]
  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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

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

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

Kenzie Togami <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[hidden email]

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

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

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=61381

Andreas Beeker <[hidden email]> 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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

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

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=61381

--- Comment #1 from Andreas Beeker <[hidden email]> ---
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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

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

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=61381

Andreas Beeker <[hidden email]> changed:

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

--- Comment #2 from Andreas Beeker <[hidden email]> ---
patched via r1804854

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Loading...