@miconda commented on this pull request.


In src/modules/tls/tls_util.h:

> @@ -39,7 +39,11 @@ static inline int tls_err_ret(char *s, tls_domains_cfg_t **tls_domains_cfg) {
 	{
 		while((err = ERR_get_error())) {
 			ret = 1;
-			ERR("%s%s\n", s ? s : "", ERR_error_string(err, 0));
+			char *errbuf = (char*)malloc(sizeof(char)*((*tls_domains_cfg)->srv_default->server_name.len+1));
+			memcpy(errbuf, (*tls_domains_cfg)->srv_default->server_name.s, (*tls_domains_cfg)->srv_default->server_name.len);
+			errbuf[(*tls_domains_cfg)->srv_default->server_name.len] = '\0';
+			ERR("%s%s -> %s -> verify_client is:%d\n", s ? s : "", ERR_error_string(err, 0), errbuf, (*tls_domains_cfg)->srv_default->verify_client);
+			free(errbuf);

There is no need to allocate memory and copy to it a 0-terminated string from (*tls_domains_cfg)->srv_default->server_name, you can use %.*s instead of %s and provide first the length and then the pointer. Should be plenty of examples in Kamailio code.

Then, because the patch is to tls module, the commit message has to be prefixed with tls: -- see contributing guidelines:


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.