summaryrefslogtreecommitdiff
path: root/src/backend/executor/nodeCustom.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2024-10-09 17:07:53 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2024-10-09 17:07:53 -0400
commita3c4a91f1e283cc4b79f0b0482d2c490a599d880 (patch)
treea8666da695a81ce31cfd26673763067b420eba94 /src/backend/executor/nodeCustom.c
parent647e76c0ff4ad81a457b66ef1581e84b5edf3f84 (diff)
Avoid crash in estimate_array_length with null root pointer.
Commit 9391f7152 added a "PlannerInfo *root" parameter to estimate_array_length, but failed to consider the possibility that NULL would be passed for that, leading to a null pointer dereference. We could rectify the particular case shown in the bug report by fixing simplify_function/inline_function to pass through the root pointer. However, as long as eval_const_expressions is documented to accept NULL for root, similar hazards would remain. For now, let's just do the narrow fix of hardening estimate_array_length to not crash. Its behavior with NULL root will be the same as it was before 9391f7152, so this is not too awful. Per report from Fredrik Widlert (via Paul Ramsey). Back-patch to v17 where 9391f7152 came in. Discussion: https://postgr.es/m/518339E7-173E-45EC-A0FF-9A4A62AA4F40@cleverelephant.ca
Diffstat (limited to 'src/backend/executor/nodeCustom.c')
0 files changed, 0 insertions, 0 deletions