forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitdce5073
committed
Turn 'if' condition around to avoid Svace complaint
The unwritten assumption of this code is that both events->head andevents->tail are NULL together (an empty list) or they aren't. So thecode was testing events->head for nullness and using that as a cue todeference events->tail, which annoys the Svace static code analyzer.We can silence it by testing events->tail member instead, and add anassertion 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 bugreport 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.org1 parent1ab67c9 commitdce5073
1 file changed
+4
-1
lines changedLines changed: 4 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
4097 | 4097 |
| |
4098 | 4098 |
| |
4099 | 4099 |
| |
4100 |
| - | |
| 4100 | + | |
| 4101 | + | |
| 4102 | + | |
4101 | 4103 |
| |
| 4104 | + | |
4102 | 4105 |
| |
4103 | 4106 |
| |
4104 | 4107 |
| |
|
0 commit comments
Comments
(0)