Uploaded image for project: 'Stripes'
  1. STS-912

Weblogic-hack in LayoutContext gets stuck when decoding multi-byte characters

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: Release 1.5.7
    • Fix Version/s: None
    • Component/s: Tag Library
    • Labels:
    • Environment:
      Windows 7 Pro
      Weblogic 10.3.6.0
      Tested from Eclipse Kepler

      Description

      In net.sourceforge.stripes.tag.layout.LayoutContext there's a newly implemented Weblogic-hack (see STS-834 Resolved and STS-823 Resolved ) that contains a bug when decoding multi-byte characters (i.e. all non-english characters).

      In the net.sourceforge.stripes.tag.layout.MyServletOutputStream.write(byte[], int, int)-method the output is written to the output stream by using a ByteBuffer. Some characters may be multi-byte, like the Danish 'ΓΈ' ([-61, -72]), which will hold two elements in the internal ByteBuffer-array.
      If the last element in the array is the first half of the multi-byte character ([-61]) the code is supposed to save it for the next round – which it actually does. But for some reason the whole character is written to the buffer again and not just the remaining byte. The buffer now contains [-61, -61, -72...] instead of [-61, -72]. This causes the UTF_8$Decoder to return a malformed input error.
      This error is not handled by the Stripes-code which in the end causes the loop in the write-method to repeat itself endlessly.

      In the StripesBug.war I have implemented an example where the bug can be reproduced.

      I'm not sure if this qualifies for a major bug but since the whole page gets stucked it will appear quite serious for the user.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              skovenborg skovenborg
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated: