forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit5a44161
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 parentf3f06b1 commit5a44161
2 files changed
+7
-1
lines changedLines changed: 3 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
4724 | 4724 |
| |
4725 | 4725 |
| |
4726 | 4726 |
| |
| 4727 | + | |
| 4728 | + | |
| 4729 | + | |
4727 | 4730 |
| |
4728 | 4731 |
| |
4729 | 4732 |
| |
|
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)