XStream

XmlHeaderAwareReader does not respect existing PushbackInputStream

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.3
  • Fix Version/s: 1.3.1
  • Component/s: Core
  • Labels:
    None

Description

If a PushbackInputStream is passed to XmlHeaderAwareReader, the class attempts to reuse that instance as a pushback inputstream without knowing any details about the existing pushback buffer.

If I pass a PushbackInputStream with a buffer size of 1 into XmlHeaderAwareReader, it will attempt to unread more than 1 byte and cause an IOException("Pushback buffer is full")

Activity

Hide
Kevin Conaway added a comment -

Patch and test case

Show
Kevin Conaway added a comment - Patch and test case
Hide
Joerg Schaible added a comment -

I've applied now a slightly different solution, where a provided PushbackInputStream is only wrapped if it cannot take all characters to "unread". Thanks for the test case though.

Show
Joerg Schaible added a comment - I've applied now a slightly different solution, where a provided PushbackInputStream is only wrapped if it cannot take all characters to "unread". Thanks for the test case though.
Hide
Joerg Schaible added a comment -

Set correct fix version.

Show
Joerg Schaible added a comment - Set correct fix version.
Hide
Joerg Schaible added a comment -

Fixed for upcoming release.

Show
Joerg Schaible added a comment - Fixed for upcoming release.

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: