pgsql: Add missing error check in regexp parser. - Mailing list pgsql-committers

From Tom Lane
Subject pgsql: Add missing error check in regexp parser.
Date
Msg-id E1UAj7u-0006kL-7r@gemulon.postgresql.org
Whole thread Raw
List 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
------
REL9_1_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/f5185db27f53b85c1386e589d7dfd9e291f3c967

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


pgsql-committers by date:

Previous
From: Tom Lane
Date:
Subject: pgsql: Add missing error check in regexp parser.
Next
From: Tom Lane
Date:
Subject: pgsql: Add missing error check in regexp parser.