forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit341e9a0
committed
Fix two NULL pointer dereferences when reading custom pgstats from file
There were two spots in pgstat_read_statsfile() where is was possible tofinish with a null-pointer-dereference crash for custom pgstats kinds:- When reading stats for a fixed-numbered stats entry.- When reading a variable stats entry with name serialization.For both cases, these issues were reachable by starting a server afterchanging shared_preload_libraries so as the stats written previouslycould not be loaded.The code is changed so as the stats are ignored in this case, like theother code paths doing similar sanity checks. Two WARNINGs are added tobe able to debug these issues. A test is added for the case offixed-numbered stats with the module injection_points.Oversights in7949d95, spotted while looking at a different report.Discussion:https://postgr.es/m/Ztj0Jftsn4xXuXtl@paquier.xyz1 parent5735521 commit341e9a0
File tree
2 files changed
+18
-0
lines changed- src
- backend/utils/activity
- test/modules/injection_points/t
2 files changed
+18
-0
lines changedLines changed: 12 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1781 | 1781 |
| |
1782 | 1782 |
| |
1783 | 1783 |
| |
| 1784 | + | |
| 1785 | + | |
| 1786 | + | |
| 1787 | + | |
| 1788 | + | |
| 1789 | + | |
1784 | 1790 |
| |
1785 | 1791 |
| |
1786 | 1792 |
| |
| |||
1861 | 1867 |
| |
1862 | 1868 |
| |
1863 | 1869 |
| |
| 1870 | + | |
| 1871 | + | |
| 1872 | + | |
| 1873 | + | |
| 1874 | + | |
| 1875 | + | |
1864 | 1876 |
| |
1865 | 1877 |
| |
1866 | 1878 |
| |
|
Lines changed: 6 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
69 | 69 |
| |
70 | 70 |
| |
71 | 71 |
| |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
72 | 78 |
|
0 commit comments
Comments
(0)