postgresql/src/backend
Michael Paquier 341e9a05e7 Fix two NULL pointer dereferences when reading custom pgstats from file
There were two spots in pgstat_read_statsfile() where is was possible to
finish 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 after
changing shared_preload_libraries so as the stats written previously
could not be loaded.

The code is changed so as the stats are ignored in this case, like the
other code paths doing similar sanity checks.  Two WARNINGs are added to
be able to debug these issues.  A test is added for the case of
fixed-numbered stats with the module injection_points.

Oversights in 7949d95945, spotted while looking at a different report.

Discussion: https://postgr.es/m/Ztj0Jftsn4xXuXtl@paquier.xyz
2024-09-05 14:36:57 +09:00
..
access Remove lc_collate_is_c(). 2024-09-04 14:35:25 -07:00
archive Apply more quoting to GUC names in messages 2024-09-04 13:50:44 +09:00
backup Define PG_TBLSPC_DIR for path pg_tblspc/ in data folder 2024-09-03 09:11:54 +09:00
bootstrap Include bison header files into implementation files 2024-08-02 10:25:11 +02:00
catalog Collect statistics about conflicts in logical replication. 2024-09-04 08:55:21 +05:30
commands Remove lc_collate_is_c(). 2024-09-04 14:35:25 -07:00
executor Optimize WindowAgg's use of tuplestores 2024-09-05 16:18:30 +12:00
foreign Restrict accesses to non-system views and foreign tables during pg_dump. 2024-08-05 06:05:33 -07:00
jit Speed up Hash Join by making ExprStates support hashing 2024-08-20 13:38:22 +12:00
lib Implement pg_wal_replay_wait() stored procedure 2024-08-02 21:16:56 +03:00
libpq Remove a couple of strerror() calls 2024-09-04 14:45:31 +02:00
main Tighten check for --forkchild argument when spawning child process 2024-07-03 15:53:30 +03:00
nodes Convert node test compile-time settings into run-time parameters 2024-08-01 10:09:18 +02:00
optimizer Avoid unnecessary post-sort projection 2024-09-04 12:19:19 +09:00
parser Revert support for ALTER TABLE ... MERGE/SPLIT PARTITION(S) commands 2024-08-24 18:48:48 +03:00
partitioning Revert support for ALTER TABLE ... MERGE/SPLIT PARTITION(S) commands 2024-08-24 18:48:48 +03:00
po Translation updates 2024-06-24 13:11:27 +02:00
port Require memory barrier support. 2024-07-30 23:01:55 +12:00
postmaster Apply more quoting to GUC names in messages 2024-09-04 13:50:44 +09:00
regex Rename enum labels of PG_Locale_Strategy 2024-09-02 08:18:41 +09:00
replication Apply more quoting to GUC names in messages 2024-09-04 13:50:44 +09:00
rewrite Avoid inserting PlaceHolderVars in cases where pre-v16 PG did not. 2024-08-30 12:42:12 -04:00
snowball Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
statistics Fix typos and duplicate words 2024-04-18 21:28:07 +02:00
storage Unify some error messages to ease work of translators 2024-09-04 14:53:18 +09:00
tcop Revert support for ALTER TABLE ... MERGE/SPLIT PARTITION(S) commands 2024-08-24 18:48:48 +03:00
tsearch Constify fields and parameters in spell.c 2024-08-06 23:04:51 +03:00
utils Fix two NULL pointer dereferences when reading custom pgstats from file 2024-09-05 14:36:57 +09:00
.gitignore Add .gitignore entries for AIX-specific intermediate build artifacts. 2015-07-08 20:44:22 -04:00
common.mk Blind attempt to fix LLVM dependency in the backend 2022-09-15 10:53:48 +07:00
Makefile Fix make build on MinGW 2024-06-21 08:17:23 +02:00
meson.build meson: Fix import library name in Windows 2024-06-20 09:08:36 +02:00
nls.mk Add missing gettext triggers 2024-05-14 12:57:22 +02:00