diff options
author | daurnimator <quae@daurnimator.com> | 2015-03-01 01:36:04 -0500 |
---|---|---|
committer | daurnimator <quae@daurnimator.com> | 2015-03-01 01:36:04 -0500 |
commit | a7dd84a94c8543ffa2dc044099cbcb731fca30d4 (patch) | |
tree | f244beeb4520418aca804934061998dd55a370f8 | |
parent | 55fd8c9610fd2dda02eb436de8c03a0fa5704048 (diff) | |
download | luaossl-a7dd84a94c8543ffa2dc044099cbcb731fca30d4.tar.gz luaossl-a7dd84a94c8543ffa2dc044099cbcb731fca30d4.tar.bz2 luaossl-a7dd84a94c8543ffa2dc044099cbcb731fca30d4.zip |
improve ALPN validation
-rw-r--r-- | src/openssl.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/openssl.c b/src/openssl.c index ab19410..f9ff4d5 100644 --- a/src/openssl.c +++ b/src/openssl.c @@ -4537,7 +4537,7 @@ static int sx_setAlpnProtos(lua_State *L) { return luaL_argerror(L, 2, "array of strings expected"); } tmp = luaL_checklstring(L, -1, &len); - luaL_argcheck(L, len <= UCHAR_MAX, 2, "proto string too long"); + luaL_argcheck(L, len > 0 && len <= UCHAR_MAX, 2, "proto string length invalid"); luaL_addchar(&B, (unsigned char)len); luaL_addlstring(&B, tmp, len); lua_pop(L, 1); |