pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Fix for a possible NPE
2+ messages / 2 participants
[nested] [flat]

* Fix for a possible NPE
@ 2010-03-20 19:50 Pierre Queinnec <pierre.queinnec@zenika.com>
  2010-03-21 07:14 ` Re: Fix for a possible NPE Kris Jurka <books@ejurka.com>
  0 siblings, 1 reply; 2+ messages in thread

From: Pierre Queinnec @ 2010-03-20 19:50 UTC (permalink / raw)
  To: pgsql-jdbc

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
^ permalink raw reply [nested|flat] 2+ messages in thread

* Re: Fix for a possible NPE
  2010-03-20 19:50 Fix for a possible NPE Pierre Queinnec <pierre.queinnec@zenika.com>
@ 2010-03-21 07:14 ` Kris Jurka <books@ejurka.com>
  0 siblings, 0 replies; 2+ messages in thread

From: Kris Jurka @ 2010-03-21 07:14 UTC (permalink / raw)
  To: Pierre Queinnec <pierre.queinnec@zenika.com>; +Cc: pgsql-jdbc



On Sat, 20 Mar 2010, Pierre Queinnec wrote:

> 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].

I've applied all of these.  I've backpatched the first which is a real 
potential problem to 8.4.

Kris Jurka




^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2010-03-21 07:14 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2010-03-20 19:50 Fix for a possible NPE Pierre Queinnec <pierre.queinnec@zenika.com>
2010-03-21 07:14 ` Kris Jurka <books@ejurka.com>

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