[JIRA] Created: (STS-912) Weblogic-hack in LayoutContext gets stuck when decoding multi-byte characters

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[JIRA] Created: (STS-912) Weblogic-hack in LayoutContext gets stuck when decoding multi-byte characters

JIRA jira@stripesframework.org
Weblogic-hack in LayoutContext gets stuck when decoding multi-byte characters
-----------------------------------------------------------------------------

                 Key: STS-912
                 URL: http://www.stripesframework.org/jira/browse/STS-912
             Project: Stripes
          Issue Type: Bug
          Components: Tag Library
    Affects Versions: Release 1.5.7
         Environment: Windows 7 Pro
Weblogic 10.3.6.0
Tested from Eclipse Kepler
            Reporter: Ulrik Skovenborg
         Attachments: StripesBug.war

In {{net.sourceforge.stripes.tag.layout.LayoutContext}} there's a newly implemented Weblogic-hack (see STS-834 and STS-823) 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.

--
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

------------------------------------------------------------------------------
DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps
OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
Free app hosting. Or install the open source package on any LAMP server.
Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk
_______________________________________________
Stripes-development mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-development