• Dridi Boukelmoune's avatar
    acceptor: Address false positive in Coverity Scan · 4e4d66b3
    Dridi Boukelmoune authored
    Upon success we expect a non-null pointer, and to make sure this is not
    residual uninitialized stack memory, it is null'd beforehand.
    
        /bin/varnishd/cache/cache_acceptor.c: 375 in vca_mk_tcp()
        369     {
        370             struct suckaddr *sa;
        371             ssize_t sz;
        372
        373             AN(SES_Reserve_remote_addr(sp, &sa, &sz));
        374             assert(sz == vsa_suckaddr_len);
        >>>     CID 1517259:  Resource leaks  (RESOURCE_LEAK)
        >>>     Failing to save or free storage allocated by "VSA_Build(sa, &wa->acceptaddr, wa->acceptaddrlen)" leaks it.
        375             AN(VSA_Build(sa, &wa->acceptaddr, wa->acceptaddrlen));
        376             sp->sattr[SA_CLIENT_ADDR] = sp->sattr[SA_REMOTE_ADDR];
    
    It is precisely because we reserve the space to store the built suckaddr
    that there won't be a malloc() call made behind our back.
    
    For some reason, it only complained about one call site.
    4e4d66b3
Name
Last commit
Last update
..
cache Loading commit data...
common Loading commit data...
fuzzers Loading commit data...
hash Loading commit data...
hpack Loading commit data...
http1 Loading commit data...
http2 Loading commit data...
mgt Loading commit data...
proxy Loading commit data...
storage Loading commit data...
waiter Loading commit data...
Makefile.am Loading commit data...
builtin.vcl Loading commit data...
flint.lnt Loading commit data...
flint.sh Loading commit data...
vclflint.lnt Loading commit data...
vclflint.sh Loading commit data...