This is the mail archive of the
java-prs@gcc.gnu.org
mailing list for the Java project.
[Bug libgcj/30600] New: gnu.gcj.convert.BytesToCharsetAdaptor calculates bad argument for java.nio.Buffer.limit(int)
- From: "kaloian at doganov dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: java-prs at gcc dot gnu dot org
- Date: 26 Jan 2007 17:11:36 -0000
- Subject: [Bug libgcj/30600] New: gnu.gcj.convert.BytesToCharsetAdaptor calculates bad argument for java.nio.Buffer.limit(int)
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Sometimes, gnu.gcj.convert.BytesToCharsetAdaptor's read method calls
inBuffer.limit(int) with a value that exceeds the buffer capacity. This can be
easily reproduced when BytesToCharsetAdaptor is used with an input byte aray
that does not have to be decoded from the start, but from a greater possition
(inpos > 0). In this case the line inBuf.limit(inpos + inlength); leads to:
java.lang.IllegalArgumentException
at java.nio.Buffer.limit(libgcj.so.7)
at gnu.gcj.convert.BytesToCharsetAdaptor.read(libgcj.so.7)
at java.lang.String.init(libgcj.so.7)
at java.lang.String.<init>(libgcj.so.7)
at BytesToCharsetAdaptorBug.main(BytesToCharsetAdaptorBug.java:6)
Please see the attached example.
--
Summary: gnu.gcj.convert.BytesToCharsetAdaptor calculates bad
argument for java.nio.Buffer.limit(int)
Product: gcc
Version: 4.1.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: libgcj
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: kaloian at doganov dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30600