pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: ml-tb <ml-tb@emagixx.de>
To: pgsql-jdbc@postgresql.org
Subject: Re: Possible bug in ServerErrorMessage.java
Date: Fri, 27 Apr 2012 10:13:57 +0200
Message-ID: <201204271013.57993.ml-tb@emagixx.de> (raw)
In-Reply-To: <CAH_hXRbsLzYBex1AdD+UW1bZdQCkoKTYf5e7_pOSNSTSytH6eQ@mail.gmail.com>
References: <CAO+LWtxB6UzLkMsSTF2E5WWegcxX2eVB4cWcKSwxwNDgiadnOA@mail.gmail.com>
	<CADK3HHLc97dm6uVpJrKHS8pUhHsaFEDu7myMUy5s4SG7KVPsKg@mail.gmail.com>
	<CAH_hXRbsLzYBex1AdD+UW1bZdQCkoKTYf5e7_pOSNSTSytH6eQ@mail.gmail.com>

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



view thread (9+ messages)  latest in thread

Message-ID: <201204271013.57993.ml-tb@emagixx.de>
Permalink:  ../201204271013.57993.ml-tb@emagixx.de/
Also on:    postgresql.org/message-id/201204271013.57993.ml-tb@emagixx.de

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: ml-tb@emagixx.de
  Subject: Re: Possible bug in ServerErrorMessage.java
  In-Reply-To: <201204271013.57993.ml-tb@emagixx.de>
  References: <CAO+LWtxB6UzLkMsSTF2E5WWegcxX2eVB4cWcKSwxwNDgiadnOA@mail.gmail.com> <CADK3HHLc97dm6uVpJrKHS8pUhHsaFEDu7myMUy5s4SG7KVPsKg@mail.gmail.com> <CAH_hXRbsLzYBex1AdD+UW1bZdQCkoKTYf5e7_pOSNSTSytH6eQ@mail.gmail.com> <201204271013.57993.ml-tb@emagixx.de>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox