[sr-dev] [kamailio/kamailio] tls: add support for escaped cert PVs and select (#2268)

Daniel-Constantin Mierla notifications at github.com
Mon Apr 6 19:36:40 CEST 2020


@armenb - there were some warnings that I got in macos compilation:

```
CC (gcc) [M tls.so]		tls_select.o
tls_select.c:765:7: warning: variable 'local' is used uninitialized whenever switch case is taken [-Wsometimes-uninitialized]
        case CERT_URLENCODED: urlencoded = 1; break;
             ^~~~~~~~~~~~~~~
tls_select.c:771:27: note: uninitialized use occurs here
        return get_ssl_cert(res, local, urlencoded, msg);
                                 ^~~~~
tls_select.c:764:7: warning: variable 'local' is used uninitialized whenever switch case is taken [-Wsometimes-uninitialized]
        case CERT_RAW: urlencoded = 0; break;
             ^~~~~~~~
tls_select.c:771:27: note: uninitialized use occurs here
        return get_ssl_cert(res, local, urlencoded, msg);
                                 ^~~~~
tls_select.c:759:11: note: initialize the variable 'local' to silence this warning
        int local, urlencoded;
                 ^
                  = 0
tls_select.c:763:7: warning: variable 'urlencoded' is used uninitialized whenever switch case is taken [-Wsometimes-uninitialized]
        case CERT_LOCAL: local = 1; break;
             ^~~~~~~~~~
tls_select.c:771:34: note: uninitialized use occurs here
        return get_ssl_cert(res, local, urlencoded, msg);
                                        ^~~~~~~~~~
tls_select.c:762:7: warning: variable 'urlencoded' is used uninitialized whenever switch case is taken [-Wsometimes-uninitialized]
        case CERT_PEER: local = 0; break;
             ^~~~~~~~~
tls_select.c:771:34: note: uninitialized use occurs here
        return get_ssl_cert(res, local, urlencoded, msg);
                                        ^~~~~~~~~~
tls_select.c:759:23: note: initialize the variable 'urlencoded' to silence this warning
        int local, urlencoded;
                             ^
                              = 0
```

I pushed a patch to initialize the variables:

  * https://github.com/kamailio/kamailio/commit/e2be8fe723ab98318816c18b59ffd086f7305040

But my guess that local and urlencoded have to be used as a combination, with both set, not only one set as it seems to be done in that switch. You know better the related code, check the commit and see if anything else needs to be done. Thanks!

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/2268#issuecomment-609935161
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-dev/attachments/20200406/fca66701/attachment.html>


More information about the sr-dev mailing list