pgsql: stringToNode() and deparse_expression_pretty() crash on invalid

From: heikki(at)postgresql(dot)org (Heikki Linnakangas)
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: stringToNode() and deparse_expression_pretty() crash on invalid
Date: 2010-06-30 18:11:04
Message-ID: 20100630181104.978017541D4@cvs.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Log Message:
-----------
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.

Tags:
----
REL8_2_STABLE

Modified Files:
--------------
pgsql/src/backend/parser:
parse_expr.c (r1.198.2.2 -> r1.198.2.3)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/parser/parse_expr.c?r1=1.198.2.2&r2=1.198.2.3)
pgsql/src/backend/tcop:
fastpath.c (r1.94 -> r1.94.2.1)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/tcop/fastpath.c?r1=1.94&r2=1.94.2.1)

Browse pgsql-committers by date

  From Date Subject
Next Message Heikki Linnakangas 2010-06-30 18:11:19 pgsql: stringToNode() and deparse_expression_pretty() crash on invalid
Previous Message Heikki Linnakangas 2010-06-30 18:10:51 pgsql: stringToNode() and deparse_expression_pretty() crash on invalid