Skip to content

Commit

Permalink
Change ossl_call_keylog_cb_args.line to const char *
Browse files Browse the repository at this point in the history
  • Loading branch information
cdelafuente-r7 committed Sep 19, 2022
1 parent 9f99b9e commit 97d44f8
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions ext/openssl/ossl_ssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -450,23 +450,23 @@ ossl_sslctx_session_new_cb(SSL *ssl, SSL_SESSION *sess)

struct ossl_call_keylog_cb_args {
VALUE ssl_obj;
VALUE line;
const char * line;
};

static VALUE
ossl_call_keylog_cb(VALUE args_v)
{
VALUE sslctx_obj, cb;
VALUE sslctx_obj, cb, line_v;
struct ossl_call_keylog_cb_args *args = (struct ossl_call_keylog_cb_args *) args_v;

sslctx_obj = rb_attr_get(args->ssl_obj, id_i_context);

cb = rb_attr_get(sslctx_obj, id_i_keylog_cb);
if (NIL_P(cb)) return Qnil;

args->line = rb_str_new_cstr((const char *)args->line);
line_v = rb_str_new_cstr(args->line);

return rb_funcall(cb, id_call, 2, args->ssl_obj, args->line);
return rb_funcall(cb, id_call, 2, args->ssl_obj, line_v);
}

static void
Expand All @@ -480,7 +480,7 @@ ossl_sslctx_keylog_cb(const SSL *ssl, const char *line)

ssl_obj = (VALUE)SSL_get_ex_data(ssl, ossl_ssl_ex_ptr_idx);
args.ssl_obj = ssl_obj;
args.line = (VALUE)line;
args.line = line;

rb_protect(ossl_call_keylog_cb, (VALUE)&args, &state);
if (state) {
Expand Down

0 comments on commit 97d44f8

Please sign in to comment.