diff options
author | Alvaro Herrera <alvherre@alvh.no-ip.org> | 2024-09-25 16:42:02 +0200 |
---|---|---|
committer | Alvaro Herrera <alvherre@alvh.no-ip.org> | 2024-09-25 16:42:02 +0200 |
commit | dce507356a4ab7d548dca9d7abf1800a0fc0a18e (patch) | |
tree | b4a093a413fde9f516efc457e05f09d9a8b15043 /doc/src | |
parent | 1ab67c9dfaadda86059f405e5746efb6ddb9fe21 (diff) | |
download | postgresql-dce507356a4ab7d548dca9d7abf1800a0fc0a18e.tar.gz postgresql-dce507356a4ab7d548dca9d7abf1800a0fc0a18e.zip |
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
Diffstat (limited to 'doc/src')
0 files changed, 0 insertions, 0 deletions