]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Add missing error check in regexp parser.
authorTom Lane <tgl@sss.pgh.pa.us>
Wed, 27 Feb 2013 15:40:14 +0000 (10:40 -0500)
committerTom Lane <tgl@sss.pgh.pa.us>
Wed, 27 Feb 2013 15:40:14 +0000 (10:40 -0500)
commitf5185db27f53b85c1386e589d7dfd9e291f3c967
tree6ff4b4cdda07c1a07bdd6dd1ecd435d48262e843
parentbd0bfe1f8081a1e52d8cf1463c435d5f769c7339
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.
src/backend/regex/regcomp.c