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

pgsql: Make replace(), split_part(), and string_to_array() behave

From: tgl(at)postgresql(dot)org (Tom Lane)
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Make replace(), split_part(), and string_to_array() behave
Date: 2007-07-19 20:34:21
Message-ID: 20070719203421.0BB9F9FBA00@postgresql.org (view raw or flat)
Thread:
Lists: pgsql-committers
Log Message:
-----------
Make replace(), split_part(), and string_to_array() behave somewhat sanely
when handed an invalidly-encoded pattern.  The previous coding could get
into an infinite loop if pg_mb2wchar_with_len() returned a zero-length
string after we'd tested for nonempty pattern; which is exactly what it
will do if the string consists only of an incomplete multibyte character.
This led to either an out-of-memory error or a backend crash depending
on platform.  Per report from Wiktor Wodecki.

Modified Files:
--------------
    pgsql/src/backend/utils/adt:
        varlena.c (r1.156 -> r1.157)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/adt/varlena.c.diff?r1=1.156&r2=1.157)

pgsql-committers by date

Next:From: Tom LaneDate: 2007-07-19 20:34:27
Subject: pgsql: Make replace(), split_part(), and string_to_array() behave
Previous:From: Andrew DunstanDate: 2007-07-19 19:15:26
Subject: pgsql: Only use the pipe chunking protocol if we know the syslogger

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