From 63e35c161f9d1b155881d4db2626d18f1ee332a5 Mon Sep 17 00:00:00 2001 From: Petr Kristan Date: Wed, 4 Mar 2020 16:22:03 +0100 Subject: [PATCH] SOCKET_INVALID pushed as integer, not as number winsock define INVALID_SOCKET as (UINT_PTR)(~0) in win64 it is 0xffffffffffffffff if pushed by lua_pushnumber, then ssl.core.SOCKET_INVALID is 1.84467440737096E19 tested in win32/64, linux32/64 lua5.1 and lua5.3 --- src/ssl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ssl.c b/src/ssl.c index 57f17ca..7150231 100644 --- a/src/ssl.c +++ b/src/ssl.c @@ -941,7 +941,7 @@ LSEC_API int luaopen_ssl_core(lua_State *L) luaL_newlib(L, funcs); lua_pushstring(L, "SOCKET_INVALID"); - lua_pushnumber(L, SOCKET_INVALID); + lua_pushinteger(L, SOCKET_INVALID); lua_rawset(L, -3); return 1;