]> 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:32 +0000 (18:11 +0000)
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>
Wed, 30 Jun 2010 18:11:32 +0000 (18:11 +0000)
commit8f36605efc5fdf3cfcfe69f33b6fce524fd84a53
tree43c973f848ef79ebf0b2d6511a430095a769448e
parent221f4def6ca33d465c4c1057fe9cfaef69f546a4
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