]> granicus.if.org Git - postgresql/commit
stringToNode() and deparse_expression_pretty() crash on invalid input,
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>
Wed, 30 Jun 2010 18:11:43 +0000 (18:11 +0000)
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>
Wed, 30 Jun 2010 18:11:43 +0000 (18:11 +0000)
commitfa8ccf59faaec5c026e3721642487cab6fa3b34f
tree9e7ccc7ffb59aa9efe7806459ea9b7ef0876cda8
parent873b9b8a3d5d57520484fabef680e2cbddc58760
stringToNode() and deparse_expression_pretty() crash on invalid input,
but we have nevertheless exposed them to users via pg_get_expr(). It would
be too much maintenance effort to rigorously check the input, so put a hack
in place instead to restrict pg_get_expr() so that the argument must come
from one of the system catalog columns known to contain valid expressions.

Per report from Rushabh Lathia. Backpatch to 7.4 which is the oldest
supported version at the moment.
src/backend/parser/parse_expr.c
src/backend/tcop/fastpath.c
src/include/catalog/pg_constraint.h