forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commita3c4a91
committed
Avoid crash in estimate_array_length with null root pointer.
Commit9391f71 added a "PlannerInfo *root" parameter toestimate_array_length, but failed to consider the possibility thatNULL would be passed for that, leading to a null pointer dereference.We could rectify the particular case shown in the bug report by fixingsimplify_function/inline_function to pass through the root pointer.However, as long as eval_const_expressions is documented to acceptNULL for root, similar hazards would remain. For now, let's just dothe narrow fix of hardening estimate_array_length to not crash.Its behavior with NULL root will be the same as it was before9391f71, so this is not too awful.Per report from Fredrik Widlert (via Paul Ramsey). Back-patch to v17where9391f71 came in.Discussion:https://postgr.es/m/518339E7-173E-45EC-A0FF-9A4A62AA4F40@cleverelephant.ca1 parent647e76c commita3c4a91
2 files changed
+7
-1
lines changedLines changed: 3 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
4635 | 4635 |
| |
4636 | 4636 |
| |
4637 | 4637 |
| |
| 4638 | + | |
| 4639 | + | |
| 4640 | + | |
4638 | 4641 |
| |
4639 | 4642 |
| |
4640 | 4643 |
| |
|
Lines changed: 4 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2131 | 2131 |
| |
2132 | 2132 |
| |
2133 | 2133 |
| |
| 2134 | + | |
| 2135 | + | |
| 2136 | + | |
2134 | 2137 |
| |
2135 | 2138 |
| |
2136 | 2139 |
| |
| |||
2154 | 2157 |
| |
2155 | 2158 |
| |
2156 | 2159 |
| |
2157 |
| - | |
| 2160 | + | |
2158 | 2161 |
| |
2159 | 2162 |
| |
2160 | 2163 |
| |
|
0 commit comments
Comments
(0)