Commit 0daeba0
committed
Be more paranoid in ruleutils.c's get_variable().
We were merely Assert'ing that the Var matched the RTE it's supposedly
from. But if the user passes incorrect information to pg_get_expr(),
the RTE might in fact not match; this led either to Assert failures
or core dumps, as reported by Chris Hanks in bug #14220. To fix, just
convert the Asserts to test-and-elog. Adjust an existing test-and-elog
elsewhere in the same function to be consistent in wording.
(If we really felt these were user-facing errors, we might promote them to
ereport's; but I can't convince myself that they're worth translating.)
Back-patch to 9.3; the problematic code doesn't exist before that, and
a quick check says that 9.2 doesn't crash on such cases.
Michael Paquier and Thomas Munro
Report: <20160629224349.1407.32667@wrigleys.postgresql.org>1 parent 86437dd commit 0daeba0
1 file changed
+8
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5967 | 5967 | | |
5968 | 5968 | | |
5969 | 5969 | | |
5970 | | - | |
| 5970 | + | |
| 5971 | + | |
5971 | 5972 | | |
5972 | 5973 | | |
5973 | 5974 | | |
| |||
6028 | 6029 | | |
6029 | 6030 | | |
6030 | 6031 | | |
6031 | | - | |
| 6032 | + | |
| 6033 | + | |
| 6034 | + | |
6032 | 6035 | | |
6033 | | - | |
| 6036 | + | |
| 6037 | + | |
| 6038 | + | |
6034 | 6039 | | |
6035 | 6040 | | |
6036 | 6041 | | |
| |||
0 commit comments