diff options
author | daurnimator <quae@daurnimator.com> | 2015-03-01 02:09:15 -0500 |
---|---|---|
committer | daurnimator <quae@daurnimator.com> | 2015-03-01 02:09:15 -0500 |
commit | e08e76d91148fb360c918ac08be4c7c6ad76e749 (patch) | |
tree | 9247ba207cc1509e0a45decb437f499f550d8cf9 /src | |
parent | a7dd84a94c8543ffa2dc044099cbcb731fca30d4 (diff) | |
download | luaossl-e08e76d91148fb360c918ac08be4c7c6ad76e749.tar.gz luaossl-e08e76d91148fb360c918ac08be4c7c6ad76e749.tar.bz2 luaossl-e08e76d91148fb360c918ac08be4c7c6ad76e749.zip |
SSL_CTX_set_alpn_protos takes the full length, not the number of strings
Diffstat (limited to 'src')
-rw-r--r-- | src/openssl.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/openssl.c b/src/openssl.c index f9ff4d5..562927d 100644 --- a/src/openssl.c +++ b/src/openssl.c @@ -4544,8 +4544,8 @@ static int sx_setAlpnProtos(lua_State *L) { } done: luaL_pushresult(&B); - - if (0 != SSL_CTX_set_alpn_protos(ctx, (const unsigned char*)lua_tostring(L, -1), protos_len)) { + tmp = lua_tolstring(L, -1, &len); + if (0 != SSL_CTX_set_alpn_protos(ctx, (const unsigned char*)tmp, len)) { lua_pushnil(L); return 1; } |