db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kristian Waagan (JIRA)" <j...@apache.org>
Subject [jira] Commented: (DERBY-4088) DDMReader readBytes ArrayIndexOutOfBoundsException
Date Tue, 10 Mar 2009 15:10:51 GMT

    [ https://issues.apache.org/jira/browse/DERBY-4088?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12680503#action_12680503
] 

Kristian Waagan commented on DERBY-4088:
----------------------------------------

I downloaded the test program, and can confirm that it triggers the bug.
Note that you should use Java SE 6 and derbyclient.jar, because the drivers isn't loaded explicitly
by the test program.

Here's the stack trace:
2009-03-10 15:04:28.064 GMT:
 Booting Derby version The Apache Software Foundation - Apache Derby - 10.5.0.0 alpha - (752129M):
instance a816c00e-011f-f0e9-8206-000003d35e00
on database directory /tmp/db  

Database Class Loader started - derby.database.classpath=''
2009-03-10 15:05:36.546 GMT Thread[DRDAConnThread_3,5,main] (DATABASE = db), (DRDAID = NF000001.D3F3-4110940798161594440{2}),
null
2009-03-10 15:05:36.546 GMT : null
java.lang.ArrayIndexOutOfBoundsException
        at java.lang.System.arraycopy(Native Method)
        at org.apache.derby.impl.drda.DDMReader.readBytes(DDMReader.java:1509)
        at org.apache.derby.impl.drda.DRDAConnThread.readAndSetParams(DRDAConnThread.java:4697)
        at org.apache.derby.impl.drda.DRDAConnThread.parseSQLDTA_work(DRDAConnThread.java:4507)
        at org.apache.derby.impl.drda.DRDAConnThread.parseSQLDTA(DRDAConnThread.java:4379)
        at org.apache.derby.impl.drda.DRDAConnThread.parseEXCSQLSTTobjects(DRDAConnThread.java:4254)
        at org.apache.derby.impl.drda.DRDAConnThread.parseEXCSQLSTT(DRDAConnThread.java:4084)
        at org.apache.derby.impl.drda.DRDAConnThread.processCommands(DRDAConnThread.java:1003)
        at org.apache.derby.impl.drda.DRDAConnThread.run(DRDAConnThread.java:290)
2009-03-10 15:05:36.547 GMT Thread[DRDAConnThread_3,5,main] (DATABASE = db), (DRDAID = NF000001.D3F3-4110940798161594440{2}),
Execution failed because of Permanent Agent Error: SVRCOD = 40; RDBNAM = db; diagnostic msg
= null
2009-03-10 15:05:36.547 GMT : Execution failed because of Permanent Agent Error: SVRCOD =
40; RDBNAM = db; diagnostic msg = null
org.apache.derby.impl.drda.DRDAProtocolException: Execution failed because of Permanent Agent
Error: SVRCOD = 40; RDBNAM = db; diagnostic msg = null
        at org.apache.derby.impl.drda.DRDAProtocolException.newAgentError(DRDAProtocolException.java:339)
        at org.apache.derby.impl.drda.DRDAConnThread.sendUnexpectedException(DRDAConnThread.java:7993)
        at org.apache.derby.impl.drda.DRDAConnThread.handleException(DRDAConnThread.java:7944)
        at org.apache.derby.impl.drda.DRDAConnThread.run(DRDAConnThread.java:315)
2009-03-10 15:05:36.547 GMT : null
java.lang.ArrayIndexOutOfBoundsException
        at java.lang.System.arraycopy(Native Method)
        at org.apache.derby.impl.drda.DDMReader.readBytes(DDMReader.java:1509)
        at org.apache.derby.impl.drda.DRDAConnThread.readAndSetParams(DRDAConnThread.java:4697)
        at org.apache.derby.impl.drda.DRDAConnThread.parseSQLDTA_work(DRDAConnThread.java:4507)
        at org.apache.derby.impl.drda.DRDAConnThread.parseSQLDTA(DRDAConnThread.java:4379)
        at org.apache.derby.impl.drda.DRDAConnThread.parseEXCSQLSTTobjects(DRDAConnThread.java:4254)
        at org.apache.derby.impl.drda.DRDAConnThread.parseEXCSQLSTT(DRDAConnThread.java:4084)
        at org.apache.derby.impl.drda.DRDAConnThread.processCommands(DRDAConnThread.java:1003)
        at org.apache.derby.impl.drda.DRDAConnThread.run(DRDAConnThread.java:290)


> DDMReader readBytes ArrayIndexOutOfBoundsException
> --------------------------------------------------
>
>                 Key: DERBY-4088
>                 URL: https://issues.apache.org/jira/browse/DERBY-4088
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Server
>    Affects Versions: 10.4.2.0
>         Environment: CentOS 5, java 1.6.0_11
>            Reporter: Urban Widmark
>         Attachments: derby-ddm.patch, DerbyBug.java
>
>
> DDMReader.readBytes(int length) checks the length vs DssConstants.MAX_DSS_LENGTH, but
ignores the fact that the buffer position "pos" might not be 0. If pos is non-zero then the
pos + length can be larger than the size of "buffer" causing an ArrayIndexOutOfBoundsException.
> For me this happened when sending a BLOB that was 32766 bytes long. The value of pos
was 2 in that method.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message