From e08e76d91148fb360c918ac08be4c7c6ad76e749 Mon Sep 17 00:00:00 2001 From: daurnimator Date: Sun, 1 Mar 2015 02:09:15 -0500 Subject: SSL_CTX_set_alpn_protos takes the full length, not the number of strings --- src/openssl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') 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; } -- cgit v1.2.3-59-g8ed1b