[CONJ-220] Connection error occured: java.lang.IndexOutOfBoundsException Created: 2015-11-18  Updated: 2015-11-20  Resolved: 2015-11-20

Status: Closed
Project: MariaDB Connector/J
Component/s: Other
Affects Version/s: 1.3.0
Fix Version/s: 1.3.2

Type: Bug Priority: Blocker
Reporter: Christian Bourque Assignee: Diego Dupin
Resolution: Fixed Votes: 0
Labels: None
Environment:

MariaDB 10.0.17


Attachments: File stacktrace.log    

 Description   

An exception is thrown in PacketOutputStream.sendStream (see attached stacktrace for details)! The implementation of sendStream is faulty (line 169):

while ((len = reader.read(buffer, 0, (int) readLength)) > 0)

In my case, readLength == 36214! You cannot read more data than the buffer size and hence the exception (here reader is a StringReader)! The readLength parameter of reader.read should be replaced by something like that:

reader.read(buffer, 0, buffer.length)



 Comments   
Comment by Diego Dupin [ 2015-11-19 ]

Ok, the problem is clear, and will be corrected in a correction release quickly.

Comment by Diego Dupin [ 2015-11-20 ]

Will be integrated to correction release 3.1.2 (urgent release).

github commit : https://github.com/MariaDB/mariadb-connector-j/commit/71e319cb573b95d1924193789ac0aaa478a21854

travis tests : https://travis-ci.org/MariaDB/mariadb-connector-j/builds/92227580

Generated at Thu Feb 08 03:14:04 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.