Possible bug in ServerErrorMessage.java

From: Fedechicco <fedechicco(at)gmail(dot)com>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: Possible bug in ServerErrorMessage.java
Date: 2012-04-26 11:34:17
Message-ID: CAO+LWtxB6UzLkMsSTF2E5WWegcxX2eVB4cWcKSwxwNDgiadnOA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Hi everbody,

I'm trying to use the postgre jdbc driver with little success.
I keep getting this incomprehensible error message:

org.postgresql.util.PSQLException: Something unusual has occured to
cause the driver to fail. Please report this exception.
at org.postgresql.Driver.connect(Driver.java:280)
at java.sql.DriverManager.getConnection(DriverManager.java:620)
at java.sql.DriverManager.getConnection(DriverManager.java:169)
at com.moxoff.meshrepository.SQLConnector.getConnection(SQLConnector.java:40)
at com.moxoff.meshrepository.MeshRepository.<init>(MeshRepository.java:23)
at com.moxoff.meshrepository.Main.main(Main.java:80)
Caused by: java.lang.ArrayIndexOutOfBoundsException: 6
at org.postgresql.util.ServerErrorMessage.<init>(ServerErrorMessage.java:48)
at org.postgresql.core.v3.ConnectionFactoryImpl.doAuthentication(ConnectionFactoryImpl.java:273)
at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:95)
at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:66)
at org.postgresql.jdbc2.AbstractJdbc2Connection.<init>(AbstractJdbc2Connection.java:124)
at org.postgresql.jdbc3.AbstractJdbc3Connection.<init>(AbstractJdbc3Connection.java:30)
at org.postgresql.jdbc3.Jdbc3Connection.<init>(Jdbc3Connection.java:24)
at org.postgresql.Driver.makeConnection(Driver.java:386)
at org.postgresql.Driver.connect(Driver.java:260)
... 5 more

From what I've seen the line 48 and the following are:

while (l_chars[l_pos] != '\0' && l_pos < l_length)
{
l_pos++;
}

which IMO should be changed in:
while (l_pos < l_length && l_chars[l_pos] != '\0')

cheers,
Fedechicco

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Prasanth Reddy 2012-04-26 14:50:11 Re: 9.1 JDBC 4 driver
Previous Message Dave Cramer 2012-04-26 01:55:14 Re: 9.1 JDBC 4 driver