Skip to content

Commit

Permalink
* NEW [ssl] Fix a segment fault here.
Browse files Browse the repository at this point in the history
Signed-off-by: wangha <[email protected]>
  • Loading branch information
wanghaEMQ committed Feb 13, 2025
1 parent 72fecdf commit e91103c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/supplemental/tls/openssl/openssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ static void
open_conn_fini(nng_tls_engine_conn *ec)
{
trace("start");
SSL_free(ec->ssl);
//SSL_free(ec->ssl);
trace("end");
}

Expand Down Expand Up @@ -729,12 +729,13 @@ open_config_own_cert(nng_tls_engine_config *cfg, const char *cert,
BIO *biocert = NULL;
X509 *xcert = NULL;
EVP_PKEY *pkey = NULL;
trace("start");
log_info("--start");

#if NNG_OPENSSL_HAVE_PASSWORD
char *dup = NULL;
if (pass != NULL) {
if ((dup = nng_strdup(pass)) == NULL) {
log_info("--end1");
return (NNG_ENOMEM);
}
}
Expand Down
1 change: 1 addition & 0 deletions src/supplemental/tls/tls_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -1376,6 +1376,7 @@ nng_tls_config_own_cert(
int rv;
nni_mtx_lock(&cfg->lock);
if (cfg->busy) {
log_info("--busy");
rv = NNG_EBUSY;
} else {
rv = cfg->ops.own_cert((void *) (cfg + 1), cert, key, pass);
Expand Down

0 comments on commit e91103c

Please sign in to comment.