pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Pierre Queinnec <pierre.queinnec@zenika.com>
To: pgsql-jdbc@postgresql.org
Subject: Fix for a possible NPE
Date: Sat, 20 Mar 2010 20:50:29 +0100
Message-ID: <4BA52705.7070406@zenika.com> (raw)

Hi guys,

Here's a little patch [1] that fixes a possible NPE. While I'm at it, I 
also attached three other patches that I had, one to suppress a unused 
field [2], another one to suppress a double null-check [3], and a small 
typo correction [4].

[1] SimpleParameterList_NPE.diff
[2] CopyOperationImpl_unused_field.diff
[3] QueryExecutorImpl_double_null_check.diff
[4] Fastpath_typo.diff

Cheers,
--
Pierre Queinnec
CTO - Zenika
http://www.zenika.com

Attachments: download all (4 files, .tar.gz)

SimpleParameterList_NPE.diff (text/plain, 1.1K) download Index: org/postgresql/core/v3/SimpleParameterList.java =================================================================== RCS file: /cvsroot/jdbc/pgjdbc/org/postgresql/core/v3/SimpleParameterList.java,v retrieving revision 1.18 diff -c -r1.18 SimpleParameterList.java *** org/postgresql/core/v3/SimpleParameterList.java 4 Feb 2010 00:48:47 -0000 1.18 --- org/postgresql/core/v3/SimpleParameterList.java 20 Mar 2010 19:39:04 -0000 *************** *** 155,161 **** p.append('\''); try { ! p = Utils.appendEscapedLiteral(p, param, protoConnection.getStandardConformingStrings()); } catch (SQLException sqle) { // This should only happen if we have an embedded null // and there's not much we can do if we do hit one. --- 155,161 ---- p.append('\''); try { ! p = Utils.appendEscapedLiteral(p, param, standardConformingStrings); } catch (SQLException sqle) { // This should only happen if we have an embedded null // and there's not much we can do if we do hit one.
CopyOperationImpl_unused_field.diff (text/plain, 670B) download Index: org/postgresql/core/v3/CopyOperationImpl.java =================================================================== RCS file: /cvsroot/jdbc/pgjdbc/org/postgresql/core/v3/CopyOperationImpl.java,v retrieving revision 1.1 diff -c -r1.1 CopyOperationImpl.java *** org/postgresql/core/v3/CopyOperationImpl.java 1 Jul 2009 05:00:40 -0000 1.1 --- org/postgresql/core/v3/CopyOperationImpl.java 20 Mar 2010 19:37:52 -0000 *************** *** 17,23 **** import org.postgresql.util.PSQLState; public class CopyOperationImpl implements CopyOperation { - String sql; QueryExecutorImpl queryExecutor; int rowFormat; int[] fieldFormats; --- 17,22 ----
QueryExecutorImpl_double_null_check.diff (text/plain, 1.4K) download Index: org/postgresql/core/v3/QueryExecutorImpl.java =================================================================== RCS file: /cvsroot/jdbc/pgjdbc/org/postgresql/core/v3/QueryExecutorImpl.java,v retrieving revision 1.47 diff -c -r1.47 QueryExecutorImpl.java *** org/postgresql/core/v3/QueryExecutorImpl.java 7 Dec 2009 22:03:06 -0000 1.47 --- org/postgresql/core/v3/QueryExecutorImpl.java 20 Mar 2010 19:38:33 -0000 *************** *** 980,986 **** error = new PSQLException(GT.tr("Got CopyData without an active copy operation"), PSQLState.OBJECT_NOT_IN_STATE); } else if (!(op instanceof CopyOutImpl)) { error = new PSQLException(GT.tr("Unexpected copydata from server for {0}", ! op == null ? "null" : op.getClass().getName()), PSQLState.COMMUNICATION_ERROR); } else { ((CopyOutImpl)op).handleCopydata(buf); } --- 980,986 ---- error = new PSQLException(GT.tr("Got CopyData without an active copy operation"), PSQLState.OBJECT_NOT_IN_STATE); } else if (!(op instanceof CopyOutImpl)) { error = new PSQLException(GT.tr("Unexpected copydata from server for {0}", ! op.getClass().getName()), PSQLState.COMMUNICATION_ERROR); } else { ((CopyOutImpl)op).handleCopydata(buf); }
Fastpath_typo.diff (text/plain, 928B) download Index: org/postgresql/fastpath/Fastpath.java =================================================================== RCS file: /cvsroot/jdbc/pgjdbc/org/postgresql/fastpath/Fastpath.java,v retrieving revision 1.35 diff -c -r1.35 Fastpath.java *** org/postgresql/fastpath/Fastpath.java 8 Jan 2008 06:56:28 -0000 1.35 --- org/postgresql/fastpath/Fastpath.java 20 Mar 2010 19:39:33 -0000 *************** *** 22,28 **** /** * This class implements the Fastpath api. * ! * <p>This is a means of executing functions imbeded in the org.postgresql * backend from within a java application. * * <p>It is based around the file src/interfaces/libpq/fe-exec.c --- 22,28 ---- /** * This class implements the Fastpath api. * ! * <p>This is a means of executing functions embedded in the org.postgresql * backend from within a java application. * * <p>It is based around the file src/interfaces/libpq/fe-exec.c

view thread (2+ messages)  latest in thread

Message-ID: <4BA52705.7070406@zenika.com>
Permalink:  ../4BA52705.7070406@zenika.com/
Also on:    postgresql.org/message-id/4BA52705.7070406@zenika.com

 ·  · 

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: pierre.queinnec@zenika.com
  Subject: Re: Fix for a possible NPE
  In-Reply-To: <4BA52705.7070406@zenika.com>
  References: <4BA52705.7070406@zenika.com>

* 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