postgresql/src
Alvaro Herrera dce507356a
Turn 'if' condition around to avoid Svace complaint
The unwritten assumption of this code is that both events->head and
events->tail are NULL together (an empty list) or they aren't.  So the
code was testing events->head for nullness and using that as a cue to
deference events->tail, which annoys the Svace static code analyzer.
We can silence it by testing events->tail member instead, and add an
assertion about events->head to ensure it's all consistent.

This code is very old and as far as we know, there's never been a bug
report related to this, so there's no need to backpatch.

This was found by the ALT Linux Team using Svace.

Author: Alexander Kuznetsov <kuznetsovam@altlinux.org>
Discussion: https://postgr.es/m/6d0323c3-3f5d-4137-af73-98a5ab90e77c@altlinux.org
2024-09-25 16:42:02 +02:00
..
backend Turn 'if' condition around to avoid Svace complaint 2024-09-25 16:42:02 +02:00
bin vacuumdb: Skip temporary tables in query to build list of relations 2024-09-25 14:43:16 +09:00
common jsonapi: fix memory leakage during OOM error recovery. 2024-09-23 12:30:51 -04:00
fe_utils Prevent mis-encoding of "trailing junk after numeric literal" errors. 2024-09-05 12:42:33 -04:00
include For inplace update durability, make heap_update() callers wait. 2024-09-24 15:25:18 -07:00
interfaces Add PQfullProtocolVersion() to surface the precise protocol version. 2024-09-09 11:54:55 -04:00
makefiles Add -Wmissing-variable-declarations to the standard compilation flags 2024-08-03 11:51:02 +02:00
pl Don't bother checking the result of SPI_connect[_ext] anymore. 2024-09-09 12:18:34 -04:00
port Only perform pg_strong_random init when required 2024-09-02 13:52:27 +02:00
template thread-safety: gmtime_r(), localtime_r() 2024-08-23 07:43:04 +02:00
test For inplace update durability, make heap_update() callers wait. 2024-09-24 15:25:18 -07:00
timezone Update time zone data files to tzdata release 2024a. 2024-02-01 15:57:53 -05:00
tools Add further excludes to headerscheck 2024-09-24 20:41:47 +02:00
tutorial Update copyright for 2024 2024-01-03 20:49:05 -05:00
.gitignore
DEVELOPERS
Makefile Remove distprep 2023-11-06 15:18:04 +01:00
Makefile.global.in Add -Wmissing-variable-declarations to the standard compilation flags 2024-08-03 11:51:02 +02:00
Makefile.shlib Remove AIX support 2024-02-28 15:17:23 +04:00
meson.build Update copyright for 2024 2024-01-03 20:49:05 -05:00
nls-global.mk Remove distprep 2023-11-06 15:18:04 +01:00