Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-jdbc by date

Next:From: Maciek SakrejdaDate: 2012-04-27 13:25:08
Subject: Re: Possible bug in ServerErrorMessage.java
Previous:From: FedechiccoDate: 2012-04-27 07:48:57
Subject: Re: Possible bug in ServerErrorMessage.java

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group