postgresql-jdbc.git / summary / log / commit / refs

commit    61fd8147a440e3ee9c1921ab7bb95d72911968d7
Author:   Kris Jurka <books@ejurka.com>
Date:     Tue Sep 26 04:42:18 2006 +0000

    Fix a bug in function escape processing.  When dealing with an
    invalid escape the code attempted to read until it hit the escape
    end and press on, but it forgot to increment its position counter.
    This lead to an infinite loop that eventually resulted in an out of
    memory error.


org/postgresql/jdbc2/AbstractJdbc2Statement.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/org/postgresql/jdbc2/AbstractJdbc2Statement.java b/org/postgresql/jdbc2/AbstractJdbc2Statement.java index 1d8fd35f..82f623dd 100644 --- a/org/postgresql/jdbc2/AbstractJdbc2Statement.java +++ b/org/postgresql/jdbc2/AbstractJdbc2Statement.java @@ -3,7 +3,7 @@ * Copyright (c) 2004-2005, PostgreSQL Global Development Group * * IDENTIFICATION -* $PostgreSQL: pgjdbc/org/postgresql/jdbc2/AbstractJdbc2Statement.java,v 1.90 2006/05/22 09:52:37 jurka Exp $ +* $PostgreSQL: pgjdbc/org/postgresql/jdbc2/AbstractJdbc2Statement.java,v 1.91 2006/06/08 10:34:50 jurka Exp $ * *------------------------------------------------------------------------- */ @@ -911,7 +911,7 @@ public abstract class AbstractJdbc2Statement implements BaseStatement // go to the end of the function copying anything found i++; while (i<len && p_sql.charAt(i)!='}') - newsql.append(p_sql.charAt(i)); + newsql.append(p_sql.charAt(i++)); state = IN_SQLCODE; // end of escaped function (or query) break; case ESC_TIMEDATE: [parent: ad0f53221072]