droe / sslsplit

Transparent SSL/TLS interception
https://www.roe.ch/SSLsplit
BSD 2-Clause "Simplified" License
1.73k stars 327 forks source link

fix clang-static-analysis warnings #336

Closed disaykin closed 2 days ago

disaykin commented 2 days ago
cachedsess.c:214:2: warning: Null pointer passed to 2nd parameter expecting 'nonnull' [core.NonNullParamChecker]
        memcpy(db->buf + tmp.sz + sizeof(port), sni, snilen);
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

log.c:1716:46: warning: argument 3 of type ‘int[5]’ with mismatched bound [-Warray-parameter=]
 1716 | log_init(opts_t *opts, proxy_ctx_t *ctx, int clisock[5])
      |                                          ~~~~^~~~~~~~~~
In file included from log.c:29:
log.h:97:39: note: previously declared as ‘int[3]’
   97 | int log_init(opts_t *, proxy_ctx_t *, int[3]) NONNULL(1,2) WUNRES;
      |                                       ^~~~~~~

ssl.c:1683:10: warning: Potential leak of memory pointed to by 'cn' [unix.Malloc]
                return NULL;
                       ^~~~
sonertari commented 2 days ago

Thanks