pgsql: Add missing error check in regexp parser.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Add missing error check in regexp parser.
Date: 2013-02-27 15:41:02
Message-ID: E1UAj7u-0006kG-3x@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Add missing error check in regexp parser.

parseqatom() failed to check for an error return (NULL result) from its
recursive call to parsebranch(), and in consequence could crash with a
null-pointer dereference after an error return. This bug has been there
since day one, but wasn't noticed before, probably because most error cases
in parsebranch() didn't actually lead to returning NULL. Add the missing
error check, and also tweak parsebranch() to exit in a less indirect
fashion after a call to parseqatom() fails.

Report by Tomasz Karlik, fix by me.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/73dc003beef859e0b67da463c5e28f5468d3f17f

Modified Files
--------------
src/backend/regex/regcomp.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Heikki Linnakangas 2013-02-27 16:22:53 pgsql: Add support for piping COPY to/from an external program.
Previous Message fxjr 2013-02-27 13:06:40 npgsql - Npgsql2: [#1011310] Command timeouts after the first are not