aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLibravatarLibravatar daurnimator <quae@daurnimator.com> 2015-03-01 02:09:15 -0500
committerLibravatarLibravatar daurnimator <quae@daurnimator.com> 2015-03-01 02:09:15 -0500
commite08e76d91148fb360c918ac08be4c7c6ad76e749 (patch)
tree9247ba207cc1509e0a45decb437f499f550d8cf9 /src
parenta7dd84a94c8543ffa2dc044099cbcb731fca30d4 (diff)
downloadluaossl-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.c4
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;
}