JDK-4026823 : writeUTF OutputStream doesn't throw an exception when encoding > 65536
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.io
  • Affected Version: 1.0,1.1
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: generic,solaris_1,solaris_2.4
  • CPU: generic,sparc
  • Submitted: 1997-01-20
  • Updated: 1997-10-23
  • Resolved: 1997-10-23
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
1.1 1.1fcsFixed
Related Reports
Duplicate :  
Duplicate :  
Relates :  
Relates :  
Description
If the String passed to writeUTF is encoded to more than 65536 bytes
an exception should be thrown.  It is not and the resulting byte
stream will have a corrupted length.

Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: generic FIXED IN: 1.1fcs INTEGRATED IN: 1.1fcs
14-06-2004

EVALUATION The length of the encoding is computed but not checked against the maximum specified by the JLS and the fits into the two byte length field.
11-06-2004

WORK AROUND Restrict the length of strings passed to writeUTF to 21845.
11-06-2004

PUBLIC COMMENTS If the String passed to writeUTF is encoded to more than 65536 bytes an exception should be thrown. It is not and the resulting byte stream will have a corrupted length.
10-06-2004