Re: Possible bug in ServerErrorMessage.java

From: "ml-tb" <ml-tb(at)emagixx(dot)de>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Possible bug in ServerErrorMessage.java
Date: 2012-04-27 08:13:57
Message-ID: 201204271013.57993.ml-tb@emagixx.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Am Freitag, 27. April 2012 schrieb Maciek Sakrejda:
> > 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')
>
> This seems to be the code in question, to decode the wire
> ErrorResponse message:
>
> https://github.com/pgjdbc/pgjdbc/blob/master/org/postgresql/util/Serv
> erErrorMessage.java#L32
>
> Although what you suggested would be more defensive coding,
Sorry for correct you at this point: The suggested code ist not more
defensive but the only correct way for a save (unsyncronised) array
access.

Bye Thomas

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Maciek Sakrejda 2012-04-27 13:25:08 Re: Possible bug in ServerErrorMessage.java
Previous Message Fedechicco 2012-04-27 07:48:57 Re: Possible bug in ServerErrorMessage.java