Commit e9cfdc0
authored
chore: fix possible null pointer dereference found by Coverity (#223)
785 buf = p;
786
deref_ptr: Directly dereferencing pointer c.
787 if (c->addr_text.len) {
788 p = ngx_snprintf(buf, len, ", client: %V", &c->addr_text);
789 len -= p - buf;
790 buf = p;
791 }
792
CID 251610 (#1 of 1): Dereference before null check (REVERSE_INULL)check_after_deref: Null-checking c suggests that it may be null, but it has already been dereferenced on all paths leading to the check.
793 if (c && c->listening && c->listening->addr_text.len) {
794 p = ngx_snprintf(buf, len, ", server: %V", &c->listening->addr_text);
795 /* len -= p - buf; */
796 buf = p;
797 }1 parent c8086b6 commit e9cfdc0
1 file changed
+12
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
784 | 784 | | |
785 | 785 | | |
786 | 786 | | |
787 | | - | |
788 | | - | |
789 | | - | |
790 | | - | |
791 | | - | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
792 | 793 | | |
793 | | - | |
794 | | - | |
795 | | - | |
796 | | - | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
797 | 800 | | |
798 | 801 | | |
799 | 802 | | |
| |||
0 commit comments