Re: Possible bug in ServerErrorMessage.java - Mailing list pgsql-jdbc

From ml-tb
Subject Re: Possible bug in ServerErrorMessage.java
Date
Msg-id 201204271013.57993.ml-tb@emagixx.de
Whole thread Raw
In response to Re: Possible bug in ServerErrorMessage.java  (Maciek Sakrejda <msakrejda@truviso.com>)
Responses Re: Possible bug in ServerErrorMessage.java
List 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

pgsql-jdbc by date:

Previous
From: Fedechicco
Date:
Subject: Re: Possible bug in ServerErrorMessage.java
Next
From: Maciek Sakrejda
Date:
Subject: Re: Possible bug in ServerErrorMessage.java