Derby
  1. Derby
  2. DERBY-4799

IllegalArgumentException when generating error message on server

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 10.6.1.0
    • Fix Version/s: 10.7.1.1
    • Component/s: Network Server
    • Labels:
      None
    • Issue & fix info:
      Repro attached

      Description

      If you for example try to connect to a non-existing database using the client driver, and the name of the database has 18 characters or more, and at least one of the characters in the database name is a non-ascii character, the server will throw an IllegalArgumentException when trying to send the "database not found" message back to the client.

      Example:

      ij> connect 'jdbc:derby://localhost/abcdefghijklmnopqå';
      ERROR 08006: A network protocol error was encountered and the connection has been terminated: A PROTOCOL Data Stream Syntax Error was detected. Reason: 0x12. Plaintext connection attempt to an SSL enabled server?

      Printed to the console by the server:

      Tue Sep 14 09:12:05 CEST 2010 : fromIndex(60) > toIndex(59)
      java.lang.IllegalArgumentException: fromIndex(60) > toIndex(59)
      at java.util.Arrays.rangeCheck(Arrays.java:1306)
      at java.util.Arrays.fill(Arrays.java:2567)
      at org.apache.derby.impl.drda.DDMWriter.padBytes(DDMWriter.java:1254)
      at org.apache.derby.impl.drda.DDMWriter.writeScalarPaddedBytes(DDMWriter.java:992)
      at org.apache.derby.impl.drda.DRDAConnThread.writeRDBNAM(DRDAConnThread.java:583)
      at org.apache.derby.impl.drda.DRDAConnThread.writeRDBfailure(DRDAConnThread.java:1248)
      at org.apache.derby.impl.drda.DRDAConnThread.parseDRDAConnection(DRDAConnThread.java:1194)
      at org.apache.derby.impl.drda.DRDAConnThread.processCommands(DRDAConnThread.java:968)
      at org.apache.derby.impl.drda.DRDAConnThread.run(DRDAConnThread.java:294)

      1. test.diff
        2 kB
        Knut Anders Hatlen
      2. fix.diff
        1 kB
        Knut Anders Hatlen

        Issue Links

          Activity

            People

            • Assignee:
              Knut Anders Hatlen
              Reporter:
              Knut Anders Hatlen
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development